Search code examples
phprestfilesizeupload-max-filesize

What is the maximum file size allowed to send through REST API


Is there a restriction on the file size to send through the REST API?

I have a file field in a web form in my Drupal Website and sending the uploaded file to the SugarCRM application through REST API using base64_encode function.

This is working fine for the small files. But when we try to upload files around 2 MB the file, it is sending an empty value.

Is there a limit on file size that can be sent through REST API? If so, is there any other way I can send a big file(at least 2MB) to my SugarCRM application?

Google did not help me this time. If someone could, that would be great.


Solution

  • If you have root access on your machine, this is the most reliable and universal approach to increasing the maximum file upload. Find the php.ini file. The most common location for php.ini is /etc/php.ini. If the file is not there, you can determine where php.ini lives by using the phpinfo() function.

    Once you've located php.ini, there are two settings you need to change, the max post size and max file upload size.

    Maximum size of POST data that PHP will accept.

    post_max_size = 2M;

    Maximum allowed size for uploaded files.

    upload_max_filesize = 2M;

    Change these values to the maximum upload size you would like to allow. After making the changes check that the changes have been applied by checking phpinfo()