Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2006

Tip: Looking for answers? Try searching our database.

problem with uploading files in java servlets

Thread view: 
bhagaban behera - 05 Mar 2006 18:48 GMT
i wanted to upload files using a java servlet and save it in a
directory on the server.

the html form is as given:

<FORM ACTION="/PostMultiServlet"
  METHOD="POST" ENCTYPE="multipart/form-data">
<INPUT TYPE="TEXT" NAME="desc" value="">
<INPUT TYPE="FILE" NAME="filecontents" value="">
<INPUT TYPE="SUBMIT" VALUE="Submit" NAME="Submit">
</FORM>

so  in the servlet  (inside the doPost method  :
                             reponse.getParameter("filecontents")
........what does it give? just the file name or the file object itself
?
Then how do i save that file?
plz tell me.
if  u have some type of code plz put it up.it will b helpfull.
thanx
Raymond DeCampo - 05 Mar 2006 19:28 GMT
> i wanted to upload files using a java servlet and save it in a
> directory on the server.
[quoted text clipped - 15 lines]
> plz tell me.
> if  u have some type of code plz put it up.it will b helpfull.

Despite its maturity, the servlet specification still does not support
multipart/form-data encoding for uploading files.  So you will have to
use a third party solution, either one provided by your application
server or an add-on like the Apache file upload package.

HTH,
Ray

Signature

This signature intentionally left blank.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.