title: How to upload base64 image resource with dropzone?
body: <p>I'm trying to upload generated client side documents (images for the moment) with <a href="http://www.dropzonejs.com/" rel="noreferrer">Dropzone.js</a>.</p>
  
  <pre><code>// .../init.js
  
  var myDropzone = new Dropzone("form.dropzone", {
      autoProcessQueue: true
  }); 
  </code></pre>
  
  <p>Once the client have finished his job, he just have to click a save button which call the save function :</p>
  
  <pre><code>// .../save.js
  
  function save(myDocument) {
  
      var file = { 
          name: 'Test',
          src: myDocument,
      };
  
      console.log(myDocument);
  
      myDropzone.addFile(file);
  }
  </code></pre>
  
  <p>The console.log() correctly return me the content of my document</p>
  
  <pre><code> data:image/png;base64,iVBORw0KGgoAAAANS...
  </code></pre>
  
  <p>At this point, we can see the progress bar uploading the document in the drop zone but the upload failed.</p>
  
  <p>Here is my (standart dropzone) HTML form : </p>
  
  <pre><code>&lt;form action="/upload" enctype="multipart/form-data" method="post" class="dropzone"&gt;
      &lt;div class="dz-default dz-message"&gt;&lt;span&gt;Drop files here to upload&lt;/span&gt;&lt;/div&gt;
      &lt;div class="fallback"&gt;
          &lt;input name="file" type="file" /&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I got a Symfony2 controller who receive the post request.</p>
  
  <pre><code>// Get request
  $request = $this-&gt;get('request'); 
  
  // Get files
  $files = $request-&gt;files;
  
  // Upload
  $do = $service-&gt;upload($files);
  </code></pre>
  
  <p>Uploading from the dropzone (by drag and drop or click) is working and the uploads are successfull but using the myDropzone.addFile() function return me an empty object in my controller :</p>
  
  <pre><code>var_dump($files);
  </code></pre>
  
  <p>return</p>
  
  <pre><code>object(Symfony\Component\HttpFoundation\FileBag)#11 (1) {
    ["parameters":protected]=&gt;
    array(0) {
    }
  }
  </code></pre>
  
  <p>I think i don't setup correctly my var file in the save function.
  I tryied to create JS image (var img = new Image() ...) but without any success.</p>
  
  <p>Thanks for your help ! </p>