简体   繁体   中英

Multiple plupload upload buttons with one plupload call

I have a plupload call:

$("#cni, #kbis, #rcpro").pluploadQueue({
runtimes: "html5, flash",
url: "ajax.php?action=x",
max_file_size: "2mb",
chunk_size: "1mb",
multiple_queues: true,
multi_selection: false,
multipart_params: {"u_id": "<?php echo $si_r['u_id']; ?>"},
//filters: [{title : "Files", extensions : ""}],
flash_swf_url: "js/plupload.flash.swf",

init:{

BeforeUpload: function(up, file){
alert(this.attr("id"))
}

}


});

it calls this html:

<div justif="cni" id="cni"></div>
<div justif="kbis" id="kbis"></div>
<div justif="rcpro" id="rcpro"></div>

what i am trying is each time i click each plupload button to call a specific variable in this case the id attribute:

BeforeUpload: function(up, file){
alert(this.attr("id"))
}

but it does not work, anyone has an idea how to do this ?

I set a cookie on client side:

 $("#cni, #kbis, #rcpro").click(function(){
 $.cookie("justif", $(this).attr("id"));
 })

then collect it on server side.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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