Hi Steve,
thanks you very much for fast reply. I found the issue with the WebClient.UploadFile() method, it is the file size, it can handle only 4MB.
but my clients required to upload bigger files (may be 4GB or so). I think the bet is to use PUT command, but I found an issue with PUT command,
The PUT command not create the file at server end even though I Flush the stream, and when I try to access the file it returns error 500, which is obvious.BUT it works on IIS6 32 Bit
1 DOES the IIS7 support for PUT?2 On Flush, to where it get flush if the file not physical on the location that I specified?--------- My Code for PUT --------- WebClient wc = new WebClient();
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://localhost/WEBFileUpload/Data/" + uri);
request.Method = "PUT";
request.ContentLength = resource.Length;
request.AllowWriteStreamBuffering = false;
request.Timeout = int.MaxValue;request.ContentType = "application/octet-stream";using (Stream requestStream = request.GetRequestStream())
{
byte[] buffer = new byte[4096];
int bytesRead = 0;
try
{
while ((bytesRead = resource.Read(buffer, 0, buffer.Length)) != 0)
{
requestStream.Write(buffer, 0, bytesRead);
requestStream.Flush();
}
}
catch (Exception e)
{
throw e;
}
requestStream.Close();
}
try
{
request.GetResponse();
}
catch (Exception e)
Thanks,Samantha