aspose file tools*
The moose likes Servlets and the fly likes How do i upload or download a file to server? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How do i upload or download a file to server?" Watch "How do i upload or download a file to server?" New topic
Author

How do i upload or download a file to server?

Bhavani R Gupta
Greenhorn

Joined: Jul 10, 2007
Posts: 4
Hi,

my actual requirement is i need to create one jsp page which displays list of documents in a specified directory.I slect one of them and download that file and update in the local machine and then upload to server.
If i need to add one new file to server then one add button is there.
Then it will give you the browse option and upload button.then it automatically upload that file in specified directory.
How can i achieve this requirement.
I heard about multipartrequest.But i dont know how to start.
can any one share this type of code or atleast psuedo code.

thankyou very much in advance.
Jason Kwok
Ranch Hand

Joined: Mar 31, 2005
Posts: 126
I found this article which may be helpful:

http://faq.javaranch.com/view?FileUpload
Bhavani R Gupta
Greenhorn

Joined: Jul 10, 2007
Posts: 4
Thankyou Jason
Manuel Leiria
Ranch Hand

Joined: Jul 13, 2007
Posts: 171
Originally posted by Bhavani R Gupta:
Thankyou Jason


I didn't see the previous link but for file uploads, in my opinion, the best out there is from apache

http://jakarta.apache.org/commons/fileupload/


Manuel Leiria<br /> <br />--------------<br />Peace cannot be kept by force; it can only be achieved by understanding. <br /> Albert Einstein
Amit Kumargupta
Ranch Hand

Joined: Apr 13, 2007
Posts: 54
try with this link

http://www.theserverside.com/tt/articles/article.tss?l=HttpClient_FileUpload
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
The FAQ link sent by Jason Kwok will give you insight as how can you upload a file to server.

You can use HTML multiple select for displaying the filenames to choose from.
An Example.

Using Jsp you have to populate the options values.


Rahul Bhattacharjee
LinkedIn - Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How do i upload or download a file to server?