简体   繁体   English

blueimp文件上传器的唯一ID

[英]Unique id for blueimp file uploader

Im using blueimp uploader for file upload things and i have tried to get a unique id for very set of images but i end up getting a unique id for each file upload 我使用blueimp uploader进行文件上传,并且我尝试为一组图像获取唯一的ID,但最终我为每个文件上传获得了唯一的ID

i have tried to add it through the handle_file_upload function but each time its calling it and hence getting a new id everytime 我试图通过handle_file_upload函数添加它,但是每次调用它时,每次都会得到一个新的id

any help would be appretiated guys 任何帮助将不胜感激的家伙

thanks 谢谢

just count with own var. 只是用自己的变量数。 don't use index from function. 不要使用函数索引。

var i=0; // global!
....
$.each(data.files, function (index, file) {
    $i++;
    $('<p>Here is your ID:' + i+'</p>').appendTo('#container'); // e.g.
    ...
}

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

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