开发者

UPLOADIFY loader hangs on 0% when trying to use scriptData

开发者 https://www.devze.com 2023-04-07 06:00 出处:网络
I found a bug while using uploadify. When I user the scriptData attribute to pass post information to the script the loader does not work. The script is actually called and the items are uploaded but

I found a bug while using uploadify. When I user the scriptData attribute to pass post information to the script the loader does not work. The script is actually called and the items are uploaded but the loader hangs on 0 %. When you user multiple files it will hang on the first one sometimes on 95% and mostly on 0%.

It looks as tho the files arent uploaded but they are. This is very anoying though, seeing that the user will think their files arent uploaded and wait on the screen. I tried to work around this by just using GET information and putting my extra variables into the actual url in the script: attribute. This also results in the same problem. A simple note is that I am using CodeIgniter for this project so this could be a problem. It would really be helpful if this was fixed but dont know if its gonna happen any time soon.

I checked this problem on multiple browsers and have the same issue. Has anyone here dealt with this. I used to like uploadify but Im begging to start looking for somet开发者_运维问答hing else


I had this problem, too, and it drove me crazy. It turns out that the script that you're using to handle the upload has to output something - anything - before uploadify will continue. So in your 'script', like upload.php below, make the last line of the script output something at the bottom of the script - even something simple like echo "done";. This will let uploadify know that the script is finished so it can continue.

$('#file_upload').uploadify({
      'uploader'  : '/js/jquery/uploadify/uploadify.swf',
      'script'    : '/distributed/ajax/upload.php',
      'cancelImg' : '/js/jquery/uploadify/cancel.png',
      'folder'    : '/distributed/files',
      'auto'      : true,
      'scriptData': { 'request_no':req_no  },
      'onComplete': function(evt, ID, fileObj, response, data) {
                        alert("Finished!");
                        }
                     }

   });
0

精彩评论

暂无评论...
验证码 换一张
取 消