当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - Getting all files that have been submitted with a form using OneUp's UploaderBundle and blueimp's jQuery-file-upload

问题描述:

In out website, we wish to present the users with a form that would allow them to upload picture galleries. The form consists of a <textarea> for a description, a <select> with sharing options and the multiple file upload field.

We're using jQuery-file-upload's jquery-ui version, as seen in here: link and our javascript code is pretty much identical. The only significant difference is that we also added a simple submit button, that sends out a POST request to the form's action.

The problem is that we need to reference ALL the files in a GalleryPost object, and the POST request that we get from the form only contains the values of <textarea> and <select>. Which makes sense, since the uploading is done asynchronously via separate requests.

Since we're using OneUpUploaderBundle to handle the actual uploads, we've tried enabling the orphanage feature described here, which kinda helps doing what we want, but as stated in the "known limitations" section, if the user does not submit the form, but starts over with a new one, the previously uploaded files will be submitted, together with the new ones, unless the session id is changed.

Simply put, we need a way to attach a list of files (names would suffice), that have been successfully uploaded, to the form's POST request, so that we could reference them in our GalleryPost object. Or maybe there is some other way to achieve the functionality we need?

分享给朋友:
您可能感兴趣的文章:
随机阅读: