Blueimp jQuery File Upload plugin - “Empty file upload” result PHP

后端 未结 6 862
暖寄归人
暖寄归人 2021-01-04 22:59

Here\'s the plugin: https://github.com/blueimp/jQuery-File-Upload

I\'m having a problem getting the response I want from the plugin after uploading a file.

O

6条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-04 23:28

    Since the version 5 of the plugin, the json response has changed: https://github.com/blueimp/jQuery-File-Upload/wiki/JSON-Response

    So you just have tweak your upload class with:

    $filejson = new stdClass();
    $filejson->files[] = $fileArray;
    return json_encode($filejson);
    

    And you're done

提交回复
热议问题