Reputation:
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.
Upvotes: 0
Views: 1840
Reputation: 1108722
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.
Upvotes: 1
Reputation: 94645
You cannot use request.getParameter()
with a form having "multipart/form-data"
. Use FileUpload API (Apache commons).
Upvotes: 1