duanliang1019 2013-06-14 08:13
浏览 351
已采纳

uploadifive选择文件,没有任何反应

I've already read many posts on this subject, but none had an answer that works for me.

I'm using uploadifive to upload images. When I select a file, and click open, nothing happens. I get no errors in my console, or when I use onError from uploadifive it self, it also gives me nothing. The onSelect gives me this:

count: 1, selected: 1, replaced: 0, errors: 0 , queued: 1

The onUpload alerts me that there is one file to upload. So I guess it does select the file, but it just won't upload. The uploadScript also doesn't appear in my console/network, so it seems to not even fire that part.

The even weirder part is that I've used uploadifive in another part of my website and there it works fine. But when I copy the code to another part, it doesn't work.

Do I miss something or am I doing something wrong?

EDIT: my code (i've put in every single one function that uploadifive has to see which ones fires and which one doesn't)

$('#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.');
}        

}); 

This is what my console says: screenshot console

  • 写回答

1条回答 默认 最新

  • dongshiliao7990 2013-06-14 11:36
    关注

    I kind of answered my own question. I have know idea how, but if I don't use the jquery-uploadifive.js file but the jquery-uploadify.min.js file, it works! The strange part is that I haven't changed a thing in the unminified version.. but well it works. Thanks everyone for helping.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 LiBeAs的带隙等于0.997eV,计算阴离子的N和P
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 来真人,不要ai!matlab有关常微分方程的问题求解决,
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算