title: Upload file asynchronously using remotipart on drag and drop
body: <p>I have my own implementation of text editor and would like to allow users to upload files by dragging and dropping it to the text editor. The editor uses iframe. I am using rails and remotipart to do async upload of image files. I tried using this plugin: <a href="http://chrismbarr.github.io/FileDrop/" rel="nofollow">http://chrismbarr.github.io/FileDrop/</a>  but I can't figure out how to upload files using remotipart. I tried using AJAX but I am sure it is not the right way and moreover it does not work either:</p>
  
  <pre><code>$('#wysiwygtextfield').contents().find("html").fileDrop(
       {
        onFileRead:function(fileCollection){
  
             $.each(fileCollection, function(){
      // I should probably be uploading files to the server using remotipart here. 
      // the plugin iterates through the collection of files that are dropped 
            });
                                            },
           removeDataUriScheme: true
       }); 
     }) ;
  </code></pre>
  
  <p>Please comment if you need more code, the upload action or the html. I am using the following form to do async uploads of files using the remotipart gem and it works fine:</p>
  
  <pre><code>&lt;%= form_for(:image, :remote =&gt; true , :url =&gt; 'upload',:multipart =&gt; true , 
               :html =&gt; { :id =&gt; 'upload_qimage'}) do |f| %&gt;
  
   &lt;%= f.file_field :image, :placeholder =&gt; 'No file chosen',:onchange =&gt; "$(this).parents('form').submit(); before_submit() ; ",class: "image_textbox"  %&gt;
  
  &lt;% end %&gt;
  </code></pre>