简体   繁体   English

单个文件上传的多个实例(使用精细上传器)

[英]Several instances of a single file upload (using fine-uploader)

I would like to use fine-uploader in my JQuery based front-end. 我想在基于JQuery的前端中使用fine-uploader。

On my webpage the user has to upload a dozen of specific documents to the PHP back-end. 在我的网页上,用户必须将大量特定文档上载到PHP后端。

I'd like to have for each document a separate button (image link instead of a regular button), to choose exactly 1 file (.pdf, .doc, .xls). 我想为每个文档有一个单独的按钮(图像链接而不是常规按钮),以精确选择1个文件(.pdf,.doc,.xls)。 The selected file is then shown in a disabled input field and automatically uploaded. 然后,所选文件显示在禁用的输入字段中,并自动上传。 My jQuery callback then has the corresponding file UUID from the back-end. 然后,我的jQuery回调从后端具有相应的文件UUID。

Is it possible to hide/disable the green progressbar when/after uploading? 上传时/之后是否可以隐藏/禁用绿色进度条?

Where do I start? 我从哪里开始? Do I need different instances for each of my files? 每个文件都需要不同的实例吗? Could someone direct me to a simmilar code sample? 有人可以将我引导到类似代码示例吗?

Addressing your questions in order: 按顺序解决您的问题:

  • Have a look at the extraButtons option/feature . 看一看extraButtons选项/功能 This will allow you to point Fine Uploader at as many extra upload buttons you want. 这样一来,您就可以将Fine Uploader指向所需的多个其他上传按钮。 Fine Uploader will attach a "hidden" <input type="file"> to each. Fine Uploader将为每个附件附加一个“隐藏的” <input type="file">
  • You can make any changes you want to the look and feel of Fine Uploader's default UI via your own CSS rules, or you can design your own UI entirely and just leverage Fine Uploader's API. 您可以通过自己的CSS规则对Fine Uploader的默认UI的外观进行任何更改,也可以完全设计自己的UI,而仅利用Fine Uploader的API。 You can also get a handle on any specific file's parent element in the UI via the getItemByFileId method . 您还可以通过getItemByFileId方法获取UI中任何特定文件的父元素的getItemByFileId This will return the parent HTMLElement that contains all elements in the UI for that specific file. 这将返回父HTMLElement ,该HTMLElement包含UI中该特定文件的所有元素。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM