Solved

Uploading a file in JSP and storing in mysql database

Posted on 2004-08-06
7
235 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 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: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 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
topping3 challenge 14 68
Installed softare without GUID 6 65
Adding Namespace to the second node of the xml 16 60
C# DataGridView_RowsAdded event not firing 1 63
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 fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

948 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

24 Experts available now in Live!

Get 1:1 Help Now