File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Uploading from a web page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Uploading from a web page" Watch "Uploading from a web page" New topic
Author

Uploading from a web page

Ben Roy
Ranch Hand

Joined: Nov 01, 2000
Posts: 70
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

Joined: Sep 29, 2000
Posts: 8521
Read the file in . . .
Write the file out . . .
Or am I missing something here?


"JavaRanch, where the deer and the Certified play" - David O'Meara
Ben Roy
Ranch Hand

Joined: Nov 01, 2000
Posts: 70
How do I read a file in from the request object?
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Try reading this from the I/O forum.
Ben Roy
Ranch Hand

Joined: Nov 01, 2000
Posts: 70
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Uploading from a web page
 
Similar Threads
How to pass a class object from servlet to jsp page
How do I refresh a page automatically from within an html page?
Hidden fields in Javascript
Navigational Handler with Servlet or JSP
hml:link