Why Posting a base64 encoded image is sent null?
<p>I want to send a base64 encoded image to a remote server using POST method and using following code.
but the content is null in remote server with zero length.
What is wrong with it? is my encoding to base64 wrong?</p>

<pre><code>        string Base64;
         byte[] by;
         by=File.ReadAllBytes(Server.MapPath("Sunset.jpg"));
         Base64 = Convert.ToBase64String(by);
         Server.UrlEncode(Base64);
         Automation.Sending(Base64);

Automation Class:
    sending method:
    public static void sending(string Base)
        {
            String s;
            string pass ="xx";
            StringBuilder postData = new StringBuilder(1000);
            postData = new StringBuilder(100);
            postData.Append("module=Scan&amp;action=addPict");
            postData.Append("&amp;user=xxx");
            postData.Append("&amp;pass=" + pass);
            postData.Append("&amp;Id=");
            postData.Append("660913");
            postData.Append("&amp;content =" + Base);// Base64 encoded file
            s = doRequest(postData);

        }
    DoRequest method:
     private static String doRequest(StringBuilder postData)
        {
            byte[] dataArray = Encoding.UTF8.GetBytes(postData.ToString());

            HttpWebRequest httpRequest = (HttpWebRequest)WebRequest.Create("http://10.10.2.97/officeas/Runtime/process.php?");
            httpRequest.Method = "POST";
            httpRequest.ContentType = "application/x-www-form-urlencoded";

            httpRequest.ContentLength = dataArray.Length;
            Stream requestStream = httpRequest.GetRequestStream();
            requestStream.Write(dataArray, 0, dataArray.Length);
            requestStream.Flush();
            requestStream.Close();

            HttpWebResponse webResponse = (HttpWebResponse)httpRequest.GetResponse();

            if (httpRequest.HaveResponse == true)
            {
                Stream responseStream = webResponse.GetResponseStream();
                StreamReader responseReader = new System.IO.StreamReader(responseStream, Encoding.UTF8);
                String responseString = responseReader.ReadToEnd();
                return responseString;
            }
            else
                Console.Write("no response");

            return "";

        }
</code></pre>
