Hello everyone,
I am using VSTS 2008 + C# + .Net 3.5 + ASP.Net. I am using WebClient.UploadFile to upload file to a server running with ASP.Net (I use http post to upload the file to a aspx url). My question is, how to save the content of the file at server side? I find from server side, if I simply save HttpContext.Current.Request.InputStream, additional request headers (besides file content) will be saved at server side.
EDIT 1:
I have tried I need to have some code like this to receive file at server side? Is that correct code?
foreach (string f in Request.Files.AllKeys)
{
HttpPostedFile file = Request.Files[f];
file.SaveAs(@"D:\FileUpload\UploadFile.dat");
}
thanks in advance, George