File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes How to upload a file along with form data to a database using servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to upload a file along with form data to a database using servlet" Watch "How to upload a file along with form data to a database using servlet" New topic
Author

How to upload a file along with form data to a database using servlet

visu Nekk
Ranch Hand

Joined: Sep 06, 2005
Posts: 122
i have designed a form and using servlet i am sending form data to the database.now i have added one more field of input type=file and want to send the file along with the form data to the database.can anyone help me out.
[ September 06, 2005: Message edited by: visu Nekk ]
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Seek multipart/form-data you do.

Here is one thread of 200 I found searching this forum.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14111
    
  16

Use the Apache Jakarta Commons FileUpload library to handle the request with the posted form data.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Neeraj Dheer
Ranch Hand

Joined: Mar 30, 2005
Posts: 225
Or the O'Reilly Servlet package for file upload and other utilities.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to upload a file along with form data to a database using servlet