我已经使用Laravel为上传图像实现了dropzone拖放,这在我的localhost中工作正常。但是当我将它上传到我的ubuntu服务器时,它并没有上传图片,而是在浏览器控制台中显示500内部服务器错误。
这是我的查看文件代码......
{!! Form::open([ 'route' => [ 'dropzone.store' ], 'files' => true, 'enctype' => 'multipart/form-data', 'class' => 'dropzone', 'id' => 'image-upload' ]) !!}
<div>
<h5 style="text-align: center;">Drag and Drop or Click to Upload Product Images</h5>
</div>
{!! Form::close() !!}
这是javascript ...
var jsarray = [];
Dropzone.options.imageUpload = {
maxFilesize : 8,
acceptedFiles: ".jpeg,.jpg,.png,.gif",
success: function(file, response){
console.log(response.success);
}
};
路线:
Route::get('dropzone', 'ImageController@dropzone');
Route::post('dropzone/store',['as'=>'dropzone.store','uses'=>'ImageController@dropzoneStore']);
控制器:
public function dropzoneStore(Request $request)
{
$image = $request->file('file');
$imageName = time().$image->getClientOriginalName();
$path = "images";
$image->move($path,$imageName);
return response()->json(['success'=>$imageName]);
}
浏览器控制台出错:
POST http://finance.technozone.com.au/finance/dropzone/store 500 (Internal Server Error)
请有人帮我解决我的问题.....