How do you get the original filename uploaded on GAE?
Going based on the following example:
https://developers.google.com/appengine/docs/java/blobstore/overview#Uploading_a_Blob
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Blobstore upload handler rewrites the request (removing body, adding blobkey) but leaves all other stuff untouched.
The POST mimetype is
multipart/form-data, for which GAE/J offers no API to parse. So you need to use 3rd party library to parse parameters – Apache Commons-FileUpload (also as maven artifact).Use it in your
post()handler like this:Since it’s possible to upload multiple files at once you need to iterate through the set of parameters and get out the one you are interested in.