Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Uploading from a web page

 
Ben Roy
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an administration page for a site where I need the user to be able to upload an image from their local drive. Can someone give me some direction on how to do this? I can get as far as putting in a browse button and letting them select the file, but how do I handle this on the server side?
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read the file in . . .
Write the file out . . .
Or am I missing something here?
 
Ben Roy
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I read a file in from the request object?
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try reading this from the I/O forum.
 
Ben Roy
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think we're still missing something. Let me walk you through a scenario:
Customer_A logs into the web site via Internet Explorer. Let's say the web server is at my site. Customer_A goes into the products administration page and clicks on "add". A form comes up which has fields for product name, description, price, etc. There is also an image field. Next to it is a browse button. They click browse, navigate to the image on *their* computer, then submit the form and the file is uploaded to the *server*. What I'm trying to figure out is, on the page that the form submits to (jsp or servlet) how can I receive that file out of the request object.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic