我已经阅读了很多关于这个主题的帖子,但没有一个适合我的答案。
我正在使用 uploadifive 上传图片。当我选择一个文件并单击open
时,没有任何反应。我的控制台没有任何错误,或者当我onError
从 uploadifive 中使用它时,它也没有给我任何东西。给onSelect
了我这个:
计数:1,选择:1,替换:0,错误:0,排队:1
onUpload
提醒我有一个文件要上传。所以我猜它确实选择了文件,但它不会上传。uploadScript
也没有出现在我的控制台/网络中,所以它似乎甚至没有触发那部分。
更奇怪的部分是我在我网站的另一部分使用了uploadifive,它工作正常。但是当我将代码复制到另一部分时,它不起作用。
我错过了什么还是我做错了什么?
编辑:我的代码(我已经放入了 uploadifive 必须查看哪些函数触发哪些函数不触发的每一个函数)
$('#mediafile_upload').uploadifive({
'uploadScript' : '/mediafiles/uploadimage', //waar hij heen gaat
'buttonText' : '+ Toevoegen',
'width' : '140',
'height' : '100',
'dnd' : true,
'multi' : true,
'removeCompleted' : true,
'queueID' : false,
'onUpload' : function(filesToUpload) {
alert(filesToUpload + ' files will be uploaded.');
},
'onAddQueueItem' : function(file) {
console.log('The file ' + file.name + ' was added to the queue!');
},
'onCancel' : function() {
console.log('The file ' + file.name + ' was cancelled!');
},
'onCheck' : function(file, exists) {
if (exists) {
console.log('The file ' + file.name + ' exists on the server.');
}
},
'onClearQueue' : function(queue) {
queue.css('border', '2px solid #F00');
},
'onDestroy' : function() {
console.log('Oh noes! you destroyed UploadiFive!');
},
'onDrop' : function(file, fileDropCount) {
console.log(fileDropCount + ' files were dropped onto the queue.');
},
'onError' : function(errorType) {
console.log('The error was: ' + errorType);
},
'onInit' : function() {
console.log('Add files to the queue to start uploading.');
},
'onProgress' : function(file, e) {
console.log('onprogress file: ' + file);
console.log('onprogress e: ' + e);
},
'onQueueComplete' : function(uploads) {
console.log(uploads.successful + ' files were uploaded successfully.');
},
'onSelect' : function(queue) {
console.log(queue.queued + ' files were added to the queue.');
},
'onUpload' : function(filesToUpload) {
console.log(filesToUpload + ' files will be uploaded.');
},
'onUploadComplete' : function(file, data) {
console.log('The file ' + file.name + ' uploaded successfully.');
},
'onUploadFile' : function(file) {
console.log('The file ' + file.name + ' is being uploaded.');
}
});
这就是我的控制台所说的: