Uploadify卡住了100%,但仍然上传

Uploadify卡住了100%,但仍然上传

问题描述:

我似乎有一个uploadify的问题。无论文件是什么,它总是会在第一个文件上陷入100%。我在我的Wamp上使用了Zend,它在那里工作得很好,但是一旦我将它上载到我的Linux服务器上,它就会卡住。该文件被上传并重命名,但它永远不会触发onComplete事件并在第一个文件上保持100%。 这里是我的javascript:Uploadify卡住了100%,但仍然上传

$('#fileInput').uploadify({ 
     'uploader'   : 'http://test.thevenuelist.co.uk/js/uploadify/uploadify.swf', 
     'script'   : 'http://test.thevenuelist.co.uk/ajax/uploadify', 
     'cancelImg'   : 'http://test.thevenuelist.co.uk/js/uploadify/cancel.png', 
     'folder'  : '/userdata/images/', 
     'auto'    : true, 
     'multi'   : true, 
     'fileDesc'  : 'Image Files (*.jpg;*.jpeg;*.gif;*.png)', 
     'fileExt'  : '*.jpg;*.jpeg;*.gif;*.png', 
     'buttonText'  : 'Upload Images', 
     'removeCompleted' : true, 
     'onComplete'   : function (event, queueID, fileObj, response, data) { 
      var answer = eval('(' + response + ')'); 
      if(answer.result == "success") 
      { 
       $("#hdnImages").val($("#hdnImages").val() + answer.fileName + ","); 
       var toAdd = "<li><img src='/images/delete.png' id='removeItem' rel='"+answer.fileName+"' style='cursor:pointer;' title='Remove' alt='Remove'/>&nbsp;&nbsp;Image "+answer.realName+" uploaded</li>"; 
       $("#completedItemsList").append(toAdd); 
      } 
     }, 
     'onError': function (event, queueID ,fileObj, errorObj) { 
      alert(errorObj.info); 
     } 
    }); 

这里是我的Zend后面的代码:

$tempFile = $_FILES['Filedata']['tmp_name']; 
    $targetPath = $_SERVER['DOCUMENT_ROOT']. '/' . $_REQUEST['folder'] . '/'; 
    $fileNameArray = explode('.',$_FILES['Filedata']['name']); 
    $hash = substr(md5(microtime()),0,5); 
    $finalFileName = $fileNameArray[0].$hash.'.'.$fileNameArray[1]; 
    $targetFile = str_replace('//','/',$targetPath) . $finalFileName; 

    if(move_uploaded_file($tempFile,$targetFile)) 
    { 
     $data = array("result"=>"success","fileName"=>$finalFileName,"realName"=>$_FILES['Filedata']['name']); 
    } 
    else 
    { 
     $data = array("result"=>"failed"); 
    } 

    echo Zend_Json::encode($data); 

任何帮助将不胜感激。我花了太多时间试图弄明白。我需要我的onComplete事件来工作,以便我可以完成我的表单。

我发现与uploadify我不得不返回1或0为成功或失败得到它的工作。