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.

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

报告相同问题?

悬赏问题

  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波
  • ¥15 针对曲面部件的制孔路径规划,大家有什么思路吗
  • ¥15 钢筋实图交点识别,机器视觉代码
  • ¥15 如何在Linux系统中,但是在window系统上idea里面可以正常运行?(相关搜索:jar包)
  • ¥50 400g qsfp 光模块iphy方案
  • ¥15 两块ADC0804用proteus仿真时,出现异常
  • ¥15 关于风控系统,如何去选择