Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Dropzonejs上传顺序+Laravel_Php_Laravel_Dropzone.js - Fatal编程技术网

Php Dropzonejs上传顺序+Laravel

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

我正在使用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 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);
} 

 }

}

您提到了数据库,但我在您的代码片段中没有看到任何使用数据库的内容。请澄清。这只是一个示例代码。好的,那么您尝试了什么?为什么在你的问题中提到数据库?