The following Code You can post any type of file, mainly to convert the data stream to base64 format. // ------------------------------ send part of the response string url = "http: // localhost/IM/upfile? AA = 5 "; // the address of the page sent to httpwebrequest Req = (httpwebrequest) webrequest. create (URL); // read an image filestream FS = new filestream (server. mappath ("~ /Netbasics .doc "), system. io. filemode. open, system. io. fileaccess. read); byte [] filecontent = new byte [FS. length]; FS. read (filecontent, 0, filecontent. length); FS. close (); FS. dispose (); // convert the image to a base64 encoded stream string a = convert. tobase64string (filecontent); // read the base64 encoded stream and send byte [] requestbytes = system. text. encoding. default. getbytes (a); req. method = "Post"; req. contenttype = "application/X-WWW-form-urlencod Ed "; req. contentlength = requestbytes. length; stream requeststream = req. getrequeststream (); requeststream. write (requestbytes, 0, requestbytes. length); requeststream. close (); // receives the response parameters to string backstr httpwebresponse res = (httpwebresponse) req. getresponse (); streamreader sr = new streamreader (res. getresponsestream (), system. text. encoding. default); string backstr = sr. readtoend (); Sr. close (); Res. cl Ose (); // output parameter response. write (backstr); // --------------------------------------------------- receiving part --------------------------------- // The received parameter string BB = request. querystring ["AA"]; encoding myencoding = encoding. getencoding ("UTF-8"); // receives the transmitted data stream resstream = request. inputstream; byte [] filecontent = new byte [resstream. length]; // read the data stream into the byte array resstream. read (filecontent, 0, filecontent. length); // Array Convert to string to convert base64 using string a = myencoding. getstring (filecontent); // decrypt the string to the byte array byte [] filecontent2 = convert. frombase64string (a); // write to the directory file. writeallbytes (server. mappath ("~ /"+ BB +". Doc "), filecontent2); // return value response. Write (" OK "); response. End ();