Hi all,
i have problem in sending zip file in network.. all other formats i am able to send except .zip..
i tried a lot i dont no how to do this.. the code i have written at client side to upload file, this is suggested by microsoft here is the link
i am able to create zip file, if i try to open it says corrupted..size of the file also varying lot.
here is code
public void UploadFile(string localFile, string uploadUrl)
{
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(uploadUrl);
req.Method = "PUT";
req.AllowWriteStreamBuffering = true;
// Retrieve request stream and wrap in StreamWriter
Stream reqStream = req.GetRequestStream();
StreamWriter wrtr = new StreamWriter(reqStream);
// Open the local file
Stream Stream = File.Open(localFile, FileMode.Open);
// loop through the local file reading each line
// and writing to the request stream buffer
byte[] buff = new byte[1024];
int bytesRead;
while ((bytesRead = Stream.Read(buff, 0,1024)) > 0)
{
wrtr.Write(buff);
}
Stream.Close();
wrtr.Close();
try
{
req.GetResponse();
}
catch(Exception ee)
{
}
reqStream.Close();
please help me...
Thanks