• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Upload an Image file

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hai all,
i have a problem with uploading the image file.
In my html file i use the tag like
<input type=file name=image> and in my servlet getParameter("image") , i get the path of the file and this works fine for my local system, but i want the file to be uploaded even from client machines.
can any one help me how to modify my html and servlet program so that i can store the image in my java web server.
thanks
prabhakar.
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. Are you specifying in your HTML form that the enctype="multipart/form-data"
2. Are you specifying that the method="post"
3. out of the box, HTTPRequest doesn't understand a multipart/form-data submission, so are you using a home-made solution to parse the request appropriately, or do you have a package like com.oreilly.servlet?
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use the jspsmartupload package. It has the code for uploading images. http://www.jspsmart.com
 
Author
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
go on with mike's solution if using servlets...check on all things...
com.oreily..did help me...try it...
 
varkala prabhakar
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
than u mike,priti and malhar,
My Uploading got worked out with oreilly package. thanx for suggesting me the package.
prabhakar.
 
reply
    Bookmark Topic Watch Topic
  • New Topic