469,328 Members | 1,327 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,328 developers. It's quick & easy.

Uploading Image to Directory using Servlet

270 100+
Hello Frendz,
I'm trying to develop Servlet which simply uploads image to particular directory with unique name.

i have wrote following form:
which has two fields filename and the actual file.

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head></head>
  3. <body>
  4. <form action="UploadImageServlet" method="POST">
  5. Select Photo: <input type="file" name="txtPhoto" size="20" /><br/>
  6. FileName: <input type="text" name="txtName" size="20" /><br/>
  7. <input type="Submit" value="Submit" />
  8. </form>
  9. </body>
  10. </html>
  11.  
I know the logic but don't know the code to upload selected image to particular directory..

help needed.

regards,
Nitin Sawant
May 31 '09 #1
4 10072
JosAH
11,448 Expert 8TB
This has been done so many times before; does this help? All I did was google for file upload to servlet.

kind regards,

Jos
Jun 1 '09 #2
r035198x
13,262 8TB
A more popular one is Apache's commons-fileupload API.
Also reachable from Google.
Jun 1 '09 #3
NitinSawant
270 100+
Apache's Commons API

I've found links on net:-

http://commons.apache.org/fileupload/using.html

http://www.ietf.org/rfc/rfc1867.txt
Jun 2 '09 #4
NitinSawant
270 100+
I also found sample code

http://www.javaatwork.com/java-uploa...amplecode.html
Jun 2 '09 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by ok | last post: by
1 post views Thread by jajoo | last post: by
1 post views Thread by Vasil Slavov | last post: by
8 posts views Thread by mpar612 | last post: by
8 posts views Thread by ThunderMusic | last post: by
5 posts views Thread by thierryParent66 | last post: by
3 posts views Thread by jatin299 | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Purva khokhar | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.