1

I should write servlet that receive File from request. I want to store this file in local dir on the server. How can I do that? Thanks a lot :)

0

2 Answers 2

3

You can use fileUpload from apache found here.

Sign up to request clarification or add additional context in comments.

7 Comments

This won't help as the OP wants to download a file and not upload.
If you mean to download it from your application then you can use the FileUpload to upload it and save it wherever and then there are plenty of articles and ways of how to download it. The Elite Gentleman indicates a fine article right here and here is another link: snippets.dzone.com/posts/show/4629
@The Elite Gentleman: It sounds like a file upload from the question.
Nope!! In the FileServlet class the doGet method of @The Elite Gentleman's link, DOWNLOADS a file from the server. this link right here: balusc.blogspot.com/2007/07/… . Give it a try if you like.
@Don Roby, the first time I read it, it sounded like he wants to get a file from an HTTP request. I reupdated my post.
|
2

BalusC wrote an excellent blog on FileServlet. This will help you.

Oops, the above-mentioned article shows you how to do file download, to do file upload, use the Apache FileUpload library instead.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.