Solved

Uploading a file in JSP and storing in mysql database

Posted on 2004-08-06
7
234 Views
Last Modified: 2010-04-17
Hello i need to develop a JSP(SubmitJob.jsp) which is displaying a form first,after submitting the  form the data is storing in a mysql databse.Now what i want to do is :

i have 2 textboxes named :No of CPU's ,Architecture and one text box for uploading a file from my local system.These are the fields of the form and the table in the mysql database.
==========
No of CPU's :      
Architecture :      
PBS File Name:
==========

So i am not getting how to upload a file in JSP and store the file in the mysql databnase.Any help in this regard is greatly appreciated.

Thank you,
Rams.


0
Comment
Question by:ramsin
  • 2
  • 2
7 Comments
 
LVL 30

Accepted Solution

by:
mayankeagle earned 43 total points
ID: 11735837
Use: <input type="File"

- for selecting the file.
0
 
LVL 32

Assisted Solution

by:ldbkutty
ldbkutty earned 41 total points
ID: 11735841
Instead of storing the FILE in tha data-base(Which ofcourse is a tedious task), yopu can store the FILE in a general Folder and store the file path in the database. This could be easily done and also favored by most of the developers.
0
 
LVL 30

Expert Comment

by:mayankeagle
ID: 11735879
It would be better to store file-path, of course. However, if you move the file to a different location, make sure that you also modify the file-path. All databases also don't allow the storage of binary data (your file could have any kind of data - normal text or something else).
0
 
LVL 32

Expert Comment

by:ldbkutty
ID: 11735955
0
 
LVL 2

Assisted Solution

by:javazoom
javazoom earned 41 total points
ID: 11781445
I would add to pay attention to store file in database depending on file size. It could be problem for very large files such as movies (1GB to 8GB). It will really slow down the database to store and extract them.

I would also add three components for uploads and downloads :
For upload, UploadBean :
http://www.javazoom.net/jzservlets/uploadbean/uploadbean.html

For download, Download4J :
http://www.javazoom.net/jzservlets/download4j/download4j.html

For extended upload (HTTP, FTP) :
http://www.javazoom.net/applets/jclientupload/jclientupload.html

Hope it helps.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
A short article about a problem I had getting the GPS LocationListener working.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now