Solved

Uploading a file in JSP and storing in mysql database

Posted on 2004-08-06
7
239 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

This is about my first experience with programming Arduino.
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
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…

635 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