0

I've seen a bunch of questions here about how to upload large strings of data using AJAX to PHP, however, in what I've seen, these questions usually ask how to upload strings of around 3MB. I need to upload a much larger string.

In my case, I have a base64 encoded image with around 20 million characters (checked using "theString".length in JS). I've tried uploading it to the PHP server, but every time I check the value in PHP, it is null.

I have gone into php.ini and added post_max_size = 100M and upload_max_filesize = 100M. I also checked the phpinfo file to make sure that the changes took place. Still doesn't work. How many MB is a base64 encoded string of this length? What should I do? I heard POST doesn't have a max upload size? Is this true? Let me know if you need to see some code. By the way, I have tried uploading strings of data that are shorter and they work just fine. The only changing factor is a much longer string.

Thanks in advance!

Peter Haddad
  • 78,874
  • 25
  • 140
  • 134
David Coco
  • 63
  • 1
  • 7
  • You may need to send it as multipart form-data, check https://stackoverflow.com/questions/5392344/sending-multipart-formdata-with-jquery-ajax – apokryfos Jul 23 '17 at 08:09

1 Answers1

0

try changing 100MB to 128 MB post_max_size = 128M max_upload_size = 128M and change the max_ececution_time to 300