title: Laravel 5.5 - Cannot Get Dropzone Uploaded Files Into FileBag
body: <p>I've been using standard HTML POST in a Laravel project for file uploads and want to us Dropzone. </p>
  
  <p>I've tried looking at the documentation for Dropzone and online examples of Laravel implementation, but, I cannot get a simple file post to upload into the POST headers. </p>
  
  <p>Laravel FileBag therefore remains empty and I cannot figure out why. Dumping out $_FILE results in no files being passed into the Headers. Other than this, from a browser point of view the input box for dropzone displays fine, it's responsive and doesn't display errors when a file is uploaded. </p>
  
  <p>Any help would be appreciated. Code stripped down to the basics: </p>
  
  <p>Master Blade: </p>
  
  <pre><code>    &lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
    &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
  
      &lt;link rel="stylesheet" href="/dropzone.css"&gt;
      &lt;script src="/dropzone.js"&gt;&lt;/script&gt;
  
      &lt;meta name="description" content=""&gt;
      &lt;meta name="author" content=""&gt;
  
      &lt;link rel="icon" href="../../favicon.ico"&gt;
  
    &lt;/head&gt;
  
    &lt;body&gt;
  
  
        &lt;script type="text/javascript"&gt;
              var baseUrl = "{{ url('/testUpload') }}";
              var token = "{{ Session::Token() }}";
              Dropzone.autoDiscover = false;
               var myDropzone = new Dropzone("div#dropzoneFileUpload", { 
                   url: baseUrl,
                   params: {
                      _token: token
                    }
               });
               Dropzone.options.myAwesomeDropzone = {
                  paramName: "file", // The name that will be used to transfer the file
                  maxFilesize: 2, // MB
                  addRemoveLinks: true,
                  accept: function(file, done) {
  
                  },
                };
           &lt;/script&gt;
  
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Blade: </p>
  
  <pre><code>@extends("testmaster")
  
    &lt;form action="/testUpload" enctype="multipart/form-data" method="post" class="dropzone"&gt;
  
      {{ csrf_field() }}
  
      &lt;div class="container"&gt;
        &lt;div class="dropzone" id="dropzoneFileUpload"&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;input type="submit" value="Submit"&gt;
  
    &lt;/form&gt;
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>public function testUpload(Request $request)
  {
      dd($request);
  }
  </code></pre>
  
  <p>Route:</p>
  
  <pre><code>Route::get('/test','HomeController@test');
  Route::post('/testUpload','HomeController@testUpload');
  </code></pre>
  
  <p>Resulting Request:</p>
  
  <pre><code>Request {#38 ▼
    #json: null
    #convertedFiles: null
    #userResolver: Closure {#398 ▶}
    #routeResolver: Closure {#399 ▶}
    +attributes: ParameterBag {#40 ▶}
    +request: ParameterBag {#39 ▶}
    +query: ParameterBag {#46 ▶}
    +server: ServerBag {#42 ▶}
    +files: FileBag {#43 ▼
      #parameters: []
    }
    +cookies: ParameterBag {#41 ▶}
    +headers: HeaderBag {#44 ▶}
    #content: null
    #languages: null
    #charsets: null
    #encodings: null
    #acceptableContentTypes: null
    #pathInfo: "/testUpload"
    #requestUri: "/testUpload"
    #baseUrl: ""
    #basePath: null
    #method: "POST"
    #format: null
    #session: Store {#440 ▶}
    #locale: null
    #defaultLocale: "en"
    -isHostValid: true
    -isForwardedValid: true
    basePath: ""
    format: "html"
  }
  </code></pre>