title: How do you use Dropzone.js with chunked file uploads (PHP only)?
body: <p>I can find plenty of documentation on how to use the chunked file upload with various API's and libraries, but I am unable to find how to use Dropzone.js chunked file upload with just plain PHP.</p>
  
  <p>The documentation is very minimal. I cannot add any libraries or API's other than jQuery on the client side (JavaScript).</p>
  
  <p>My question is how do you use Dropzone.js new chunked file upload feature with PHP only on the server side. (Client side code is appreciated for setup).</p>
  
  <p>Here is the code I've attempted so far:
  Client side .js file:</p>
  
  <pre><code>    var myDropzone = new Dropzone("div#formDiv", 
      {
          url: "uploadform.php",
          params: function (files, xhr, chunk)
          {
              if (chunk)
              {
                  return
                  {
                      dzUuid=chunk.file.upload.uuid,
                      dzChunkIndex=chunk.index,
                      dzTotalFileSize=chunk.file.size,
                      dzCurrentChunkSize=chunk.dataBlock.data.size,
                      dzTotalChunkCount=chunk.file.upload.totalChunkCount,
                      dzChunkByteOffset=chunk.index * this.options.chunkSize,
                      dzChunkSize=this.options.chunkSize,
                      dzFilename=chunk.file.name;
                  };
              }
          },
          method: "post",
          timeout: 600000,
          maxFileSize: 1024,
          parallelUploads: 1,
          chunking: true,
          forceChunking: true,
          chunkSize: 1000000,
          parallelChunkUploads: true,
          retryChunks: true,
          retryChunksLimit: 3,
          chunksUploaded: function (file, done)
          {
              // All chunks have uploaded successfully
  
          },
          error: function (msg)
          {
              alert(msg.responseText);
          }
  });
  </code></pre>
  
  <p>Here is the PHP (server):</p>
  
  <pre><code>foreach ($_POST as $key =&gt; $value)
  {
      _log('key:' . $key . '; Value:' . $value);
  }
  </code></pre>
  
  <p>The above code shows nothing (_log() just echoes it to the screen and logs it in a text file).</p>
  
  <p>I looked at the send/receive headers and it only sends one call to the server.</p>
  
  <p>I've verified that the file drag/drop zone is setup correctly by Dropzone.js using the developer tools console in the browser.</p>
  
  <p>Edit: Here is the documentation for chunked uploads: <a href="https://gitlab.com/meno/dropzone/wikis/faq#chunked-uploads" rel="noreferrer">https://gitlab.com/meno/dropzone/wikis/faq#chunked-uploads</a></p>
  
  <blockquote>
    <p>Chunked uploads</p>
    
    <p>Dropzone offers the possibility to upload files in chunks. The
    relevant configuration options for this feature are:</p>
    
    <p>chunking which should be set to true</p>
    
    <p>forceChunking, if true, will always send a file in chunks, even if it
    is only one chunk</p>
    
    <p>chunkSize in bytes</p>
    
    <p>parallelChunkUploads, if true, the chunks will be uploaded
    simultaneously</p>
    
    <p>retryChunks, if true, the library will retry to upload a chunk if it
    fails</p>
    
    <p>retryChunksLimit defaults to 3</p>
    
    <p>Then there are two important callbacks. The first one is: params which
    can be a function, that receives files, xhr and chunk as the first
    argument. If chunking is enabled, you know that files only contains
    that one file, and chunk is the object holding all the information
    about the current chunk. Example:</p>
  
  <pre><code>var chunk = {
    file: file,
    index: 0,
    status: Dropzone.UPLOADING,
    progress: 0.4
  }
  </code></pre>
    
    <p>See the documentation for that parameter for more information or look
    at the source code for the default implementation.</p>
    
    <p>The second important callback is chunksUploaded, which gets the file
    that finished uploading and the done function as second argument. Do
    whatever you need to do in that function, to tell the server that the
    file finished uploading and invoke the done() function when ready.</p>
  </blockquote>