Php Dropzonejs上传顺序+Laravel
我正在使用dropzonejs和Laravel连接到我的服务器。我希望获得文件名,如文件1.jpg、2.jpg、3.jpg、4.jpg、5.jpg的顺序,或者我在dataabse中有一个字段名顺序。我想把订单保存在数据库中 我的代码:Php Dropzonejs上传顺序+Laravel,php,laravel,dropzone.js,Php,Laravel,Dropzone.js,我正在使用dropzonejs和Laravel连接到我的服务器。我希望获得文件名,如文件1.jpg、2.jpg、3.jpg、4.jpg、5.jpg的顺序,或者我在dataabse中有一个字段名顺序。我想把订单保存在数据库中 我的代码: var baseUrl = "{{ url('/') }}"; var token = "{{ Session::getToken() }}"; Dropzone.autoDiscover = false; var myDropzone = new Dropzo
var baseUrl = "{{ url('/') }}";
var token = "{{ Session::getToken() }}";
Dropzone.autoDiscover = false;
var myDropzone = new Dropzone(".dropzone", {
url: baseUrl + "/upload",
params: {
_token: token
}
});
Dropzone.options.myAwesomeDropzone = {
paramName: "flyers",
acceptedFiles: "image/*",
enqueueForUpload: true,
forceFallback: false,
dictDefaultMessage: "Drop files here to upload",
autoProcessQueue: false,
uploadMultiple: false,
maxFilesize: 2, // MB
addRemoveLinks: true,
accept: function(file, done) {
},
};
我的控制器
public function album()
{
$file = Input::file('file');
$destinationPath = 'uploads';
$filename = $file->getClientOriginalName();
$uploadSuccsess = Input::file('file')->move($destinationPath, $filename);
if( $uploadSuccsess ) {
return Response::json('success', 200);
} else {
return Response::json('error', 400);
}
}
}您提到了数据库,但我在您的代码片段中没有看到任何使用数据库的内容。请澄清。这只是一个示例代码。好的,那么您尝试了什么?为什么在你的问题中提到数据库?