title: Is there a way to attach a file to an HTML form without using the type="file" attribute of the <input> tag?
body: <p>Say I have an html page with a form for posting. The form is intended to post a file to my server, and to this end currently uses a <code>&lt;input type="file" name="attachment" ...&gt;</code> tag to attach this file data. However, what if I want to programmatically attach this file data instead of manually browsing on my local machine? </p>
  
  <p>Say for instance I have the raw file data in text format for a file and I want to attach that to the form. I've tried things along the lines of </p>
  
  <pre><code>&lt;input type="hidden" name="attachment" value=myRawFileData ...&gt;
  </code></pre>
  
  <p>However when an <code>&lt;input type="file"&gt;</code> is submitted with the form there are two attributes <code>filename</code> and <code>Content-Type</code> that show up in the post, and when I use the method mentioned above the only attribute that appears is the <code>name="attachment"</code> one. So I'm assuming these are specific to the whatever html File object is being attached through the type="file" attribute. Is there a way to attach a hmtl "file object" without using <code>type="file"</code> and browsing on the local machine?</p>