PHP Upload File Through REST: Using HTTP POST JSON data Return Blank Page

If you are:

  • Using REST API (XML RPC Hybrid, a.k.a. calling URL)
  • Submit a large volumn of data (e.g. 10MB) through JSON base64 string
  • Submit using HTTP POST to a URL
  • Get a blank page (no return) after submit
  • No error log 
Check these 3 things:

In your php.ini:
  1. upload_file_size has big enough value.  e.g. 10MB or 15MB
  2. post_max_size has big enough value.  e.g. 10MB or 15MB
  3. memory_limit has big enough value.  e.g. 128MB
If you just changed the first two and still get blank page when you upload, chances are you have already exhausted your memory.  Raise your memory so as to make the page load.

It is particularly useful if you are using mobile service (iPhone, Android) to upload image to server using base64.  

Hope it helps someone.

Comments

Popular posts from this blog

TCPDF How to show/display Chinese Character?

How to fix fancy box/Easy Fancybox scroll not work in mobile

Wordpress Load balancing: 2 web servers 1 MySQL without any Cloud services