Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Uploading a file in JSP and storing in mysql database

Posted on 2004-08-06
7
Medium Priority
?
242 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:
Mayank S earned 172 total points
ID: 11735837
Use: <input type="File"

- for selecting the file.
0
 
LVL 32

Assisted Solution

by:ldbkutty
ldbkutty earned 164 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:Mayank S
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 2

Assisted Solution

by:javazoom
javazoom earned 164 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
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 …
Introduction to Processes

926 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