使用 dropzone 上传图片时 POST ajax 出错

Error with POST ajax during image upload with dropzone

我有一个表格,其中包含 dropzone.js。在我收到 POST 错误:500 (Internal Server Error) on dropzone.js:1386

之后,该插件一直工作到预览图像
Dropzone.prototype.submitRequest = function(xhr, formData, files) {
      return xhr.send(formData);<--here
    }; 

我的看法:

Dropzone.options.images = false;
 $("#images").dropzone({ 
  url: "{{url('/')}}/ajax-uploadvehicleimage",
  paramName: "file",
  maxFiles: 10,
    maxfilesexceeded: function(file) {
        this.removeFile(file);
        alert('you no have more picture avaible! Pay for more here');
    },
     error: function(file, response) {
        if($.type(response) === "string")
            var message = response; //dropzone sends it's own error messages in string
        else
            var message = response.message;
      
        file.previewElement.classList.add("dz-error");
        _ref = file.previewElement.querySelectorAll("[data-dz-errormessage]");
        _results = [];
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
            node = _ref[_i];
            _results.push(node.textContent = message);
        }

        return _results;
    },
     success: function(file,done) {
       alert(done);
    }
});
<div id="images" class="dropzone">
 </div>

路线:

Route::post('/ajax-uploadvehicleimage','VehicleAddController@uploadimg');

控制器:

public function uploadimg(){
         if (Request::hasFile('file'))
    {
        //houston we have a file!
        $file = Request::file('file');

        //move it to our public folder and rename it to $name
        Request::file('file')->move('images', 'insert_file_name.'.$file->getClientOriginalExtension());
        echo 'file uploaded!';
        var_dump($file);
    }else{
        echo 'no file, no bueno';
    }
    }

可以解释一下问题出在哪里,我该如何更改或取样?我读了很多关于那个的话题,但没有人发布!

编辑: Laravel.log:

[2017-01-13 07:55:38] local.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Can't use function return value in write context' in E:\bitnami\apache2\htdocs\vehicle\app\Http\Controllers\VehicleAddController.php:103
Stack trace:
#0 {main}  

试试改成这个

public function uploadimg(){
            $file = Request::file('file');
      if ($file) {
            //move it to our public folder and rename it to $name
            $file->move('images', 'insert_file_name.'.$file->getClientOriginalExtension());
            echo 'file uploaded!';
            var_dump($file);
        }else{
            echo 'no file, no bueno';
        }
     }

另外,当您在 chrome 上转到“网络”选项卡时,当您上传它时,对错误的响应预览是什么?