title: What encoding is used for multipart/form-data and is it possible to encode data using JQuery?
body: <p>I actually want to send a picture to my server using jQuery without using html form. But I would like to retrieve the same data as I received with an html form with the encode type: </p>
  
  <pre><code>multipart/form-data
  </code></pre>
  
  <p>I used HTML5 FileReader : <a href="http://www.html5rocks.com/en/tutorials/file/dndfiles/" rel="nofollow">http://www.html5rocks.com/en/tutorials/file/dndfiles/</a></p>
  
  <p>but when I use <code>FileReader.readAsText(Blob|File, opt_encoding)</code> function. The data I retrieved are not encoded as the same as it's encoded with the html form.</p>
  
  <p>What encoding is used for "multipart/form-data" and is it possible to encode data using jquery or javascript before send them to my server?</p>
  
  <p>//edit</p>
  
  <p>from w3schools : <a href="http://www.w3schools.com/html5/att_form_enctype.asp" rel="nofollow">http://www.w3schools.com/html5/att_form_enctype.asp</a></p>
  
  <p>multipart/form-data ==> No characters are encoded. This value is required when you are using forms that have a file upload control</p>
  
  <p>the problem that I have is that when I retrieve the data from FileReader it's not the same data that from HTML form data.</p>
  
  <p>for the same picture:
  with html form :</p>
  
  <pre><code>\xff\xd8\xff\xe1\x00\x18Exif\x00\x00II*\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xec\x00\x11Ducky\x00\x01\x00\x04\x00\x00\x00U\x00\x00\xff\xe1\x03)http://ns.adobe.com/xap/1.0/\x00&lt;?xpacket begin="\xef\xbb\xbf" id="W5M0MpCehiHzreSzNTczkc9d"?&gt;...
  </code></pre>
  
  <p>with FileReader.readAsText():</p>
  
  <pre><code>\xc3\xbf\xc3\x98\xc3\xbf\xc3\xa1\\u0000\\u0018Exif\\u0000\\u0000II*\\u0000\\b\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\xc3\xbf\xc3\xac\\u0000\\u0011Ducky\\u0000\\u0001\\u0000\\u0004\\u0000\\u0000\\u0000U\\u0000\\u0000\xc3\xbf\xc3\xa1\\u0003)http://ns.adobe.com/xap/1.0/\\u0000&lt;?xpacket begin=\\"\xc3\xaf\xc2\xbb\xc2\xbf\\" id=\\"W5M0MpCehiHzreSzNTczkc9d\\"?&gt;
  </code></pre>
  
  <p>How to retrieve the same data? </p>