Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

webclient uploadfile method adding headers

Nov 3, 2005 2:06PM PST

Hello
I am uploading a file using WebClient(ASP.net C#)
this is my code

path=MapPath(''f.xml''); destpath=Server.MapPath(''./try/f.xml'');
myWebClient.UploadFile(destpath,path);

This codes works great and uploads my file..but what it also does is add header which i dont want.
eg:
-----------------------8c7ae9efe20ea5a
Content-Disposition: form-data; name=''file''; filename=''f.xml''
Content-Type: application/octet-stream

(ACTUAL FILE CONTENT DATA)

-----------------------8c7ae9efe20ea5a

How do i get rid of this headers appearing above and below my file content??

Thanks

tyrant


ASP.net C#.

Discussion is locked