I am creating a website where the users can upload photos,videos and also write or create posts.It's almost like a blog.I am using JSP.I have used "multipart/form data".But I am facing a problem.Whenever the user is clicking on the submit button,all the photos and videos cannot be uploaded at the same time.Besides,since I am using "multipart/form data" I cannot retrieve the values by request.getParameter() in the next page.So what should I do?I searched across many websites and found a code on uploading which included Disk and Iterator interfaces.But I am having problem in resolving them.Someone help me please.
2 Answers
You cannot use request.getParameter()
with a form having "multipart/form-data"
. Use FileUpload API (Apache commons).

- 93,659
- 19
- 148
- 186
-
I used FileUpload API(Apache commons).But as I said I am having problems with resolving.It's giving me errors. – Mainak Sikdar Sep 26 '11 at 19:29
Whenever the user is clicking on the submit button,all the photos and videos cannot be uploaded at the same time.
This cannot be true. This problem is caused by something else. Perhaps you're using JavaScript to submit the form on a click/change of the file field, or you are misinterpreting the process at the server side.
Besides,since I am using "multipart/form data" I cannot retrieve the values by request.getParameter() in the next page.So what should I do?
Use the same API as you have used to parse the uploaded file (you did use one, right?). That very same API should be able to give you those parameters back from the multipart/form-data
body.
See also:
-
I am using Javascript but not for submitting the form.By Javascript I am dynamically increasing the number of fields and clearing the fields. – Mainak Sikdar Sep 26 '11 at 19:33