aspose file tools*
The moose likes Java in General and the fly likes Uploading and using a file from a web page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Uploading and using a file from a web page" Watch "Uploading and using a file from a web page" New topic
Author

Uploading and using a file from a web page

Tomas Nilson
Ranch Hand

Joined: Jan 14, 2002
Posts: 33
Hello!
I have a web page where I want users to be able to select a file from their harddrive and then upload it to my web server where my Java Bean will parse the spread sheet using POI.
I have already solved the last bit (I have made an application which parses a document from the HD), but how do I upload the file? How do I pass it on to the bean?
Thanks a lot!!
/Tom
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60045
    
  65

To upload a file you need to use a multi-part form and the "file" input element to create the upload controls on your web page.
Then, write a servlet to post this form to that can parse the resulting multi-part request. The servlet can create an instance of your bean and pass the file data to it.
Search these forums for terms like "file upload", "multipart form" and "smart upload" to find lots of topics that discuss this very issue.
hth,
bear
P.S. Further questions on this topic might be better suited to the servlets forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Toseef Alam
Greenhorn

Joined: Aug 15, 2003
Posts: 2
I want to upload a file from one server to another server. I have a local server where i have a web based application. I want to upload a zip file from this local server to remote server and user doesn't know about that file. User only click a upload button and local server should read that file and submit a rewuest with this file to the remote server.
Please, somebody help me for this. If anybody have any other way to do write me that also.
Thanks,
Toseef


TAlam
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1871
hi,
it seems u need ftp rather than multi-part request here as u don't want user to see anything.
i guess u can look for 3rd party ftp clients in java on google.
regards
maulin
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Uploading and using a file from a web page
 
Similar Threads
FTPing files
dynamic insert under upload
File upload to a different url than hosting server
Passing data between pages/requests - Best practice
refresh onload