471,873 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,873 software developers and data experts.

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>
I know the logic but don't know the code to upload selected image to particular directory..

help needed.

Nitin Sawant
May 31 '09 #1
4 10187
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,

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

I've found links on net:-


Jun 2 '09 #4
270 100+
I also found sample code

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
reply views Thread by zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.