views:

565

answers:

1

How do you replicate a traditional POST form (file post) in code, the end goal is to stream a byte array as the file into the posted form, the example below is the form that I am trying to replicate in code.

    <form method="POST" action="http://export.writer.zoho.com/remotedoc.im?apikey=[apikey]&amp;output=editor" enctype="multipart/form-data" target="_self">
<input type="file" name="content" size="38"> <br>
<input type="hidden" name="filename" value="mydocument.doc">
<input type="hidden" name="saveurl" value="[REMOTE SERVER SAVE URL]">
<input type="hidden" name="id" value="12345678">
<input type="hidden" name="format" value="doc">
<input type="submit" value="Edit" class="divbutton" name="submit">
</form>
A: 

This is done using HttpWebRequestClass , an example of how to do this can be found here http://netomatix.com/HttpPostData.aspx

RC1140
I have read through that article but I cannot see how I would incorporate the file data, from what I can tell the values are concatenated into the request, it doesn't seem like that would work for file data
CodeKiwi
Partial credit, The article didn't really help but pointing me towards using HttpWebRequest did. Thanks.
CodeKiwi
No Prob , if i had seen your reply earlier i would have mentioned that you need to send the file using a stream , if you have found a valid solution please post it here so others will find the answer easier :)
RC1140