Php Laravel 5.3中的文件上载错误(对成员函数move()的错误调用为null)

Php Laravel 5.3中的文件上载错误(对成员函数move()的错误调用为null),php,file-upload,laravel-5.3,Php,File Upload,Laravel 5.3,我正在为我的应用程序编写文档上传代码。如果我尝试执行它,即(调用null上的成员函数move()),就会出现以下错误。 谁能告诉我哪里出了问题 以下是我的DocumentInsertController文件 <?php namespace App\Http\Controllers; use Illuminate\Http\Request; class DocumentInsertController extends Controller

我正在为我的应用程序编写文档上传代码。如果我尝试执行它,即(调用null上的成员函数move()),就会出现以下错误。 谁能告诉我哪里出了问题

以下是我的DocumentInsertController文件

<?php

        namespace App\Http\Controllers;

        use Illuminate\Http\Request;

        class DocumentInsertController extends Controller
        {
              public function insertform(){
              return view('document');
           }

           public function insert(Request $request){
              $destinationPath = app_path()."/gstup";
              $DocumentName = $request->input('DocumentName');
              $photup=$request->file('DocumentImage')->move($destinationPath);
              $VendorId = $request->input('VendorId');
              //$request->file('photo')->move($destinationPath, $fileName);
              $now = new DateTime();
              DB::insert('insert into documentmaster (DocumentName, photup, VendorId, UploadedDateTime) values(?, ?, ?, ?)',[$DocumentName, $VendorId, $photup, $now]);

                   echo "Record inserted successfully.<br/>";
                   echo '<a href = "/DOCUMENT">Click Here</a> to go back.';

           }
        }

check file()output能否请您简要介绍一下,很抱歉,由于错误显示您调用了move on null object,因此无法获取您的信息。因此,请检查$request->file('DocumentImage')是否已定义。检查file()输出能否请您简要介绍更多内容,很抱歉,我无法为您解答,因为错误显示您调用了空对象上的移动。因此,请检查是否定义了$request->file('DocumentImage')。