Dropzonejs与Laravel 5(请求没有获得任何数据)

时间:2015-02-19 06:38:01

标签: ajax post dropzone.js laravel-5 laravel-request

我一直在尝试使用Laravel 5实现dropzone文件上传模块。

问题是,当上传文件时,dropzone会将完整请求发送到文件上传控制器,但是,控制器不会获取任何数据。

我错过了什么?我已经包含了我正在使用的代码。提前感谢您的时间/帮助。

视图

{!! Form::open( array( 'url' => 'admin/file/upload', "id"=>"file-upload-modal", 'class'=>"dropzone" ) ) !!}
{!! Form::close() !!}

控制器

public function upload(FileUploadRequest $request){
        //addeed this line for testing. //returns request array with an empty data set. 
        return response()->json($request);
        if($request->hasFile('file')){
            $request->file('file')->move('images');
        }
    }

它返回200状态代码,dropzone认为该文件已上传。但是,响应实际上是一个空数据集 响应:

{"attributes":{},"request":{},"query":{},"server":{},"files":{},"cookies":{},"headers":{}}

0 个答案:

没有答案