Javascript Dropzone.js-Laravel | 500内部服务器错误

Javascript Dropzone.js-Laravel | 500内部服务器错误,javascript,laravel,laravel-5,xmlhttprequest,dropzone.js,Javascript,Laravel,Laravel 5,Xmlhttprequest,Dropzone.js,我想用dropzone.js上传我的图片,我在服务器端得到图片,没问题。但当我想尝试保存时,它会给出500内部服务器错误 Dropzone.options.mDropzoneTwo = { paramName: "file", // The name that will be used to transfer the file maxFiles: 10, maxFilesize: 10, // MB url: 'images/save' , method: 'POST',

我想用dropzone.js上传我的图片,我在服务器端得到图片,没问题。但当我想尝试保存时,它会给出
500内部服务器错误

Dropzone.options.mDropzoneTwo = {
  paramName: "file", // The name that will be used to transfer the file
  maxFiles: 10,
  maxFilesize: 10, // MB
  url: 'images/save' ,
  method: 'POST',
  headers: {
    "X-CSRF-TOKEN": document.head.querySelector("[name=csrf-token]").content
   },
  uploadMultiple: true,
  accept: function(file, done) {
          done();
          },
  success: function () {
          console.log()
          }
        };
这是我的控制器。我正在将图像保存到public/uploads文件夹

 $realname = str_slug(pathinfo($request->file('file')->getClientOriginalName(), PATHINFO_FILENAME));
 $extension = $request->file('file')->getClientOriginalExtension();
 $new_name = $realname."-".time().".".$extension;
 $request->file('file')->move(public_path('uploads/'.str_slug($new_name)));
 $image = new Media();
 $image->image = str_slug($new_name);
 $image->image_path = "images/".str_slug($new_name);
 $image->image_alt_name = $realname;
 $image->save();
根据评论--


这意味着您的应用程序没有在
$request->file('file')
上获取文件对象,您可以通过打印
$request
获得更多信息,然后您也可以检查文件是否是从客户端脚本发送的

来自服务器的500响应将表明您的Laravel controller方法引发了某种错误。我会检查您的日志文件
/storage/logs/laravel.log
,看看您是否在那里找到任何东西。它显示=local.ERROR:调用数组{“userId”:1,“email”:“cervantes”上的成员函数getClientOriginalName()。ias@gmail.com,“异常”:“[object](Symfony\\Component\\Debug\\exception\\FatalThrowableError(代码:0):在/var/www/parti/app/Http/Controllers/MediaController.php:17)的数组上调用成员函数getClientOriginalName(),这是否意味着什么?我不明白