Uploadify返回HTTP 500错误,根本没有命中后端

时间:2012-04-15 23:57:46

标签: php javascript jquery codeigniter uploadify

以下是回复onError

{
    "type": "HTTP",
    "info": 500
}

后端PHP脚本可以使用常规multipart/form-data表单。但是当我使用Uploadify时,它会在onOpen事件之后立即返回错误。我查了php和apache日志,没有关于这个错误。我甚至尝试在PHP代码中使用echo某些东西,但这并没有出现在任何地方。我在端口80上使用MAMP在本地运行它。我正在使用Code Igniter,并且有一个名为process的控制器和函数upload_image(),因此链接也没有被破坏。

这是我的uploadify js代码:

$('#browse-files').uploadify({
    'uploader'  : '/libraries/uploadify/uploadify.swf',
    'script'    : '/process/upload_image',
    'folder'    : '/uploads/',
    'cancelImg' : '/libraries/uploadify/cancel.png',
    'buttonImg' : '/images/upload.png',
    'auto'      : true,
    'height'    : 40,
    'width'     : 313,
    'auto'      : true,
    'simUploadLimit': '1',
    'multi'     : true,
    'method'    : 'post',
    'fileExt'   : '*.jpg;*.jpeg;*.JPEG;*.JPG;*.gif;*.png',
    'fileDesc'  : 'Web Image Files (.JPG, .GIF, .PNG)',
    'fileDataName' : 'file',
    'onOpen'    : function(event, id){
        console.log("Starting to upload an image"); //this shows up in console
    },
    'onProgress': function(event, id, fileObj, data){
        console.log("Progress: "+data.percentage);
    },
    'onComplete': function(event, id, fileObj, resp, data){
        console.log("Upload is done.");
        console.log(resp);
   },
   'onAllComplete': function(event, data){
        console.log("All uploads are done.");
   },
   'onError'    : function(event, id, fileObj, errorObj){
        console.log( JSON.stringify(errorObj) ); //and this prints the error above
   }
});

0 个答案:

没有答案