Increase the limit of file upload size in Heroku while uploading to Dropbox

后端 未结 4 1817
情书的邮戳
情书的邮戳 2021-01-20 16:09

I have encountered an issue while uploading files to dropbox through my application that is hosted on Heroku. I wanted to upload approx 100MB files and they aren\'t being ho

相关标签:
4条回答
  • 2021-01-20 16:31

    It's actually in the Heroku doc: https://devcenter.heroku.com/articles/custom-php-settings#php-runtime-settings

    Just create a .user.ini file in the web directory with your custom directives

    0 讨论(0)
  • 2021-01-20 16:34

    In case of nginx and PHP FPM the following works:

    Add these to nginx config (typically into php-fpm.inc.conf):

    php_value[post_max_size]=100M
    php_value[upload_max_filesize]=100M
    
    0 讨论(0)
  • 2021-01-20 16:38

    To increase the file upload limit in Heroku while uploading to Dropbox, follow these steps:

    1. Create a file named custom_php.ini, preferably.
    2. Insert two attributes post_max_size and upload_max_filesize and set their value to the desired upload limit. (In my case, its 100M)
    3. Create a ProcFile and add this line web: vendor/bin/heroku-php-apache2 -i custom_php.ini .
    4. Commit these changes to Heroku.

    I missed to add post_max_size in my custom_php.ini. And by this method, you can override any php.ini configuration for Heroku.

    0 讨论(0)
  • 2021-01-20 16:50

    I was going to comment on Romain's answer, but I don't have enough points:

    The .user.ini file with the desired changes needs to be placed in the root folder, which is the /public folder if you're using Laravel.

    Just check your root folder in your Procfile.

    0 讨论(0)
提交回复
热议问题