public void HttpUpLoadFile(string strUri, string strFileName)
{
WebClient myWebClient = new WebClient();
NetworkCredential credentials = new NetworkCredential("p", "u");
myWebClient.Credentials = credentials;
FileStream fs = new FileStream(strFileName,FileMode.Open,FileAccess.Read);
BinaryReader br = new BinaryReader(fs);
Byte[] postArray = br.ReadBytes(Convert.ToInt32(fs.Length));
try
{
Stream postStream = myWebClient.OpenWrite(strUri,"PUT");
if(postStream.CanWrite)
{
postStream.Write(postArray,0,postArray.Length);
}
postStream.Close();
}
catch(Exception ex)
{}
fs.Close();
}
{
WebClient myWebClient = new WebClient();
NetworkCredential credentials = new NetworkCredential("p", "u");
myWebClient.Credentials = credentials;
FileStream fs = new FileStream(strFileName,FileMode.Open,FileAccess.Read);
BinaryReader br = new BinaryReader(fs);
Byte[] postArray = br.ReadBytes(Convert.ToInt32(fs.Length));
try
{
Stream postStream = myWebClient.OpenWrite(strUri,"PUT");
if(postStream.CanWrite)
{
postStream.Write(postArray,0,postArray.Length);
}
postStream.Close();
}
catch(Exception ex)
{}
fs.Close();
}