title: How do the files to upload get passed from Dropzone to the action URL?
body: <p>I have a form built as a custom Typo3 (PHP) extension. Before attaching Dropzone, the form works correctly- if I fill out the information, upload a file, and submit the form, the correct actions take place (in this case, this means I receive an email with all the information &amp; the uploaded file as an attachment).</p>
  
  <p>If I follow the instructions in this article <a href="https://github.com/enyo/dropzone/wiki/Combine-normal-form-with-Dropzone" rel="nofollow">Combine normal form with Dropzone</a>, I can drag and drop files onto my forms, and the file previews are visible. When I click "Submit", I get a Typo3/PHP error: </p>
  
  <pre><code>   :saveUserFiles() must be of the type array, null given
  </code></pre>
  
  <p>This looks like a problem with the way Dropzone is passing the files to the back-end- is there any way for me to look at WHAT Dropzone is passing on submit? </p>
  
  <p>Here's my Dropzone options, hardly changed from the suggestions at the FAQ page above: </p>
  
  <pre><code> Dropzone.options.general = {
                  paramName: "file", // The name that will be used to transfer the file
  
                  autoProcessQueue: false,
                  uploadMultiple: true,
                  parallelUploads: 100,
                  maxFiles: 100,
                  addRemoveLinks: true,
  
                  // The setting up of the dropzone
                  init: function() {
                      var myDropzone = this;
  
                      // First change the button to actually tell Dropzone to process the queue.
                      this.element.querySelector("button[type=submit]").addEventListener("click", function(e) {
                          // Make sure that the form isn't actually being sent.
                          e.preventDefault();
                          e.stopPropagation();
                          myDropzone.processQueue();
                      });
  
                      // Listen to the sendingmultiple event. In this case, it's the sendingmultiple event instead
                      // of the sending event because uploadMultiple is set to true.
                      this.on("sendingmultiple", function() {
                          console.log("sending multiple");
                      });
                      this.on("successmultiple", function(files, response) {
                          console.log("success multiple");
                      });
                      this.on("errormultiple", function(files, response) {
                          console.log("error multiple");
                      });
                  }
              };
  </code></pre>
  
  <p>--</p>
  
  <p><strong>Update, in response to comment:</strong></p>
  
  <p>The "normal upload" input looked like this: </p>
  
  <pre><code>&lt;input type="file" name="tx_applicationformgeneral[form][files][]" /&gt;
  </code></pre>
  
  <p>I tried putting the name of the file input into the Dropzone options, like this: </p>
  
  <pre><code>paramName: "tx_applicationformgeneral[form][files][]",
  </code></pre>
  
  <p>But got the same error back.</p>
  
  <p>Here's the whole form structure (simplified- it's a really long form):</p>
  
  <pre><code> &lt;form enctype="multipart/form-data" method="post" name="form" class="dropzone dz-clickable" id="general" action="index.php?id=328"&gt;
  
  
  &lt;fieldset&gt;
  
      &lt;legend&gt;Some input&lt;/legend&gt;
  
  
      &lt;ul class="inline-textbox"&gt;
          &lt;li&gt;
  
      &lt;input type="text" id="first_name" name="tx_applicationformgeneral[form][firstname]" value="" placeholder="Name *"&gt;
          &lt;/li&gt;
          &lt;li&gt;
  
      &lt;/ul&gt;
  &lt;/fieldset&gt;
  
  &lt;fieldset&gt;
  
      &lt;legend&gt;File upload&lt;/legend&gt;
  
      &lt;div class="dropzone-previews"&gt;
  
      &lt;/div&gt;
  
  &lt;/fieldset&gt;
  
  
  &lt;input class="button" type="submit" name="tx_applicationformgeneral[mySubmit]" value="Submit"&gt;
  
   &lt;/form&gt;
  </code></pre>
  
  <hr>
  
  <p><strong>Update 2</strong></p>
  
  <p>After looking at the POST data as suggested in comments, I can now report that what is happening is that when the form is that the "Dropzoned" form sends NO data for the file upload input. The "non-Dropzoned" form sends this chunk of data if the file upload is empty: </p>
  
  <pre><code> ------WebKitFormBoundarySq0AkJrSAe1kmAOu
   Content-Disposition: form-data; name="tx_applicationformgeneral[form][files][]";      filename=""
   Content-Type: application/octet-stream
  </code></pre>
  
  <p>And this if there is a file: </p>
  
  <pre><code> ------WebKitFormBoundaryrEmFA8jYcHY56WAB
   Content-Disposition: form-data; name="tx_applicationformgeneral[form][files][]";      filename="DSC01413_01.JPG"
   Content-Type: image/jpeg
  </code></pre>
  
  <p>There is nothing corresponding to this information in the POST data once I've initialised the form as a Dropzone. </p>