I would like to do the same in C# code as a simple html page does with this
code:
<form action="http://vej-w2k3-psp/sslmodtag/WebForm1.aspx" method="post"
ENCTYPE="multipart/form-data"
ID="Form1">
<input type="file" name="test" ID="File1"> <input type="submit"
ID="Submit1" NAME="Submit1" />
</form>
Upload a file to a http page.
I know I can do it with the following C# code:
WebClient myWebClient = new WebClient();
byte[] responseArray =
myWebClient.UploadFile("http://vej-w2k3-psp/sslmodtag/WebForm1.aspx","POST",
@"c:\fileName");
But this will put the file in the request.Files["file"] (the "file" index),
and I wanna be able to decide the index myself. As you are able to with the
html code and the "name" attribut.
Anybody know's how to do that?
Regards Paw