Submit multiple form fields for each file in FineUploader

旧巷老猫 提交于 2019-12-14 03:12:24

问题


I have managed to get fineuploader working fine, including the submission of other form elements.

I now have a requirement to have separate form elements for each file that is submitted. If you know how youtube works, then you will see how each video gets additional form fields, then you can fill in while the video is still uploading. I can handle the additional form fields being submitted without any problems (using a separate ajax call if necessary), but how do I associate the form fields with the different files?

Is this even possible?


回答1:


You have 2 options:

  1. Wait until the user has filled out the file-specific fields (or wait until they press an "upload" button), call the setParams method on the Fine Uploader instance (passing the params as an object), and then ask Fine Uploader to upload the files. This assumes the autoUpload option is set to "false", and you have a button that starts that uploads which calls the uploadStoredFiles method on the uploader instance.

  2. Add logic to your web app that submits these additional form fields outside of Fine Uploader on demand, assuming you want to be able to have users enter this data after the upload has already started or completed. In that case, you can pass the file's UUID (created by Fine Uploader) along with the parameters/form values. Fine Uploader will already send a UUID for each file along with each upload request, so you will need to track this server-side in order to connect the file with your future request.



来源:https://stackoverflow.com/questions/18619601/submit-multiple-form-fields-for-each-file-in-fineuploader

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!