javascript - Is there a way to attach a file to an HTML form without using the type="file" attribute of the <input> tag? -
say have html page form posting. form intended post file server, , end uses <input type="file" name="attachment" ...> tag attach file data. however, if want programmatically attach file data instead of manually browsing on local machine?
say instance have raw file data in text format file , want attach form. i've tried things along lines of
<input type="hidden" name="attachment" value=myrawfiledata ...> however when <input type="file"> submitted form there 2 attributes filename , content-type show in post, , when use method mentioned above attribute appears name="attachment" one. i'm assuming these specific whatever html file object being attached through type="file" attribute. there way attach hmtl "file object" without using type="file" , browsing on local machine?
Comments
Post a Comment