title: Webservice PHP doesn't receive base64 large image
body: <p>I have an issue that i can't explain</p>
  
  <p>I have a C# program which send image ( screenshot whole web page of some url ) encoding to base64</p>
  
  <pre><code>    static string ImageToBase64(System.Drawing.Image image, System.Drawing.Imaging.ImageFormat format)
      {
          using (MemoryStream ms = new MemoryStream())
          {
              // Convert Image to byte[]
              image.Save(ms, format);
              byte[] imageBytes = ms.ToArray();
  
              // Convert byte[] to Base64 String
              string base64String = Convert.ToBase64String(imageBytes);
              return base64String;
          }
      }
  
      // image is typeof Bitmap
      string myImageData = ImageToBase64(image, System.Drawing.Imaging.ImageFormat.Jpeg);
  
      using (WebClient client = new WebClient())
          {
              try
              {
  
                  byte[] response = client.UploadValues("http://production/ws/imageBuilder", new NameValueCollection()
                  {
                      { "myImageData", HttpUtility.UrlEncode(this.myImageData) }
                      { "Url_", url.Authority },
                      { "token", ImageHash }
                  });
  
                  Debug.WriteLine("Server Said: " + System.Text.Encoding.Default.GetString(response));
  
                  byte[] response2 = client.UploadValues("http://localhost/ws/imageBuilder", new NameValueCollection()
                  {
                      { "myImageData", HttpUtility.UrlEncode(this.myImageData) }
                      { "Url_", url.Authority },
                      { "token", ImageHash }
                  });
  
                  Debug.WriteLine("Server Said: " + System.Text.Encoding.Default.GetString(response2));
              } 
              catch(Exception e) {Debug.WriteLine(e.Message);}
          }
  </code></pre>
  
  <p>On PHP side I have just for testing</p>
  
  <pre><code>        echo "length before decode ".strlen($_POST['myImageData']);
          $imageData = base64_decode(urldecode($_POST['myImageData']));
          echo "length after decode ".strlen($imageData);
  </code></pre>
  
  <p>Which is returning with large image ( exemple 1280 x 10 000 )</p>
  
  <pre><code>[4908] Server Said: length before decode 0   length after decode 0 
  [4908] Server Said: length before decode 1333258   length after decode 925151
  </code></pre>
  
  <p>So on my local WAMP server ( on Windows 7 ) I receive the image but in production ( on Linux ) i receive nothing.</p>
  
  <p>But with "small" image for exemple dimension "1280 x 1024" it's okay, my variable <code>$_POST['myImageData']</code> is not empty on production, it works fine. </p>
  
  <pre><code>[4908] Server Said: length before decode 66292 length after decode 46210 
  [4908] Server Said: length before decode 66292 length after decode 46210 
  </code></pre>
  
  <p><strong>UPDATE :</strong> Images are small JPG ( between 200ko and 1.5mo ). </p>
  
  <p>on my php.in in production I have</p>
  
  <pre><code>upload_max_filesize = 20M
  post_max_size = 18M
  </code></pre>
  
  <p>My Apache in production is <strong>mod_proxy</strong></p>