I am using WebClient.UploadFile method to upload a file to a web page.
The code is like this:
WebClient client = new WebClient();
byte responseBinary = client.UploadFile(url, fileName);
string response = Encoding.UTF8.GetString(responseBinary);
But I can not upload it to server.
I used fiddler to see what happens, and it shows me the following information:
http status code: 302, request headers: POST /testing/upload/default.aspx HTTP/1.1
http status code: 302, request headers: GET /testing/upload/default.aspx?AspxAutoDetectCookieSupport=1 HTTP/1.1
http status code: 200, request headers: GET /(X(1)S(22pynhvxd3eqsb455pudx145))/testing/upload/default.aspx?AspxAutoDetectCookieSupport=1 HTTP/1.1
I would like to know, why I get 302 code, and why it redirect me to the strange url with (X(1)S(22pynhvxd3eqsb455pudx145)) ?
By the way, the web page is ok to upload file by using web explorer.
View Complete Post