Iam用JQuery Uploadify V3.1瘋狂。Uploadify v3.1通過POST數據
// setup fileuploader
$("#file_upload").uploadify({
'swf': 'flash/uploadify.swf',
'uploader' : 'upload/do-upload',
'debug' : false,
'buttonText': 'Files auswählen',
'multi': true,
'method': 'POST',
'auto': false,
'width': 250,
'queueSizeLimit' : 10,
'fileSizeLimit' : '100MB',
'cancelImg': 'img/uploadify-cancel.png',
'removeCompleted' : true,
'onUploadSuccess' : function(file, data, response) {
$('#message').append(data);
},
'onUploadError' : function() {
$('#message').html('<h2>Fehler beim Upload</h2>');
}
});
要開始下載的onclick
// handle the event stuff
$("#event_start_upload").on({
click: function(){
var key = $('#key').val();
if (key.length < KeyLength) {
$('#form-encryption-control').addClass('error');
return;
} else {
$('#form-encryption-control').removeClass('error');
}
// some space for new download links
$('#message').empty();
$('#file_upload').uploadify('upload','*')
}
});
我的問題是:我要addtional PARAMS傳遞到服務器端,在Uploadify V2有一個方法uploadifySettings通過 「scriptData」,而不是在V3 ?有人知道這是如何工作的?
如果別人需要的線索:
'onUploadStart' : function(file) {
var key = $('#key').val();
$("#file_upload").uploadify('settings', 'formData', {'key' : key});
},
作品的形象使用,但如何做到這一動態? 「onUploadStart」不會改變任何東西? – opHASnoNAME
@ArneRie即時添加另一個答案,請期待它,在我的項目中我使用該代碼,它的工作正常。 –