Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
825 views
in Technique[技术] by (71.8m points)

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

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 hosted on Heroku itself. I couldn't find anything on docs that'd address this issue entirely.

I tried an hack, I created a file named custom_php.ini and in ProcFile I added this line:

web: vendor/bin/heroku-php-apache2 -i custom_php.ini .

And in my custom_php.ini file I set upload_max_filesize to 100M.

But this didn't work for the files of size more than 10MB. What I'm missing here? Is it even possible? Is there any official way around?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...