public class UpLoadFile
{
public static void UpLoadFiles(string fileName)
{
string fileType = Path.GetExtension(fileName);
string upLoadParms = "?Service=notify" + "&fileType=" + fileType;
WebRequest webRequest = HttpWebRequest.Create(new Uri("http://192.168.0.1:8080" + upLoadParms));
System.Text.Encoding coding = System.Text.Encoding.UTF8;
webRequest.ContentType = "application/x-www-form-urlencoded";
webRequest.Method = "POST";
System.IO.Stream requeStream = webRequest.GetRequestStream();
FileStream fileStream=new FileStream(fileName,FileMode.Open,FileAccess.Read);
BinaryReader binaryReader=new BinaryReader(fileStream,coding);
byte[] buffer = binaryReader.ReadBytes((int) fileStream.Length);
requeStream.Write(buffer,,buffer.Length);
fileStream.Close();
requeStream.Close();
System.Net.WebResponse response = webRequest.GetResponse();
Stream responseStream = response.GetResponseStream();
StreamReader streamReader = new StreamReader(responseStream);
string returnVal = streamReader.ReadToEnd();
responseStream.Close();
response.Close();
}
}