上传到 Dropbox 时增加 Heroku 中文件上传大小的限制 [英] Increase the limit of file upload size in Heroku while uploading to Dropbox
问题描述
我在通过 Heroku 上托管的应用程序将文件上传到 Dropbox 时遇到问题.我想上传大约 100MB 的文件,但它们没有托管在 Heroku 本身上.我在文档中找不到可以完全解决此问题的任何内容.
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.
我尝试了一个 hack,我创建了一个名为 custom_php.ini
的文件,并在 ProcFile
中添加了这一行:
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 .
在我的 custom_php.ini
文件中,我将 upload_max_filesize
设置为 100M
.
And in my custom_php.ini
file I set upload_max_filesize
to 100M
.
但这不适用于大小超过 10MB 的文件.我在这里缺少什么?甚至有可能吗?有官方的方法吗?
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?
推荐答案
要在上传到 Dropbox 时增加 Heroku 中的文件上传限制,请按照下列步骤操作:
To increase the file upload limit in Heroku while uploading to Dropbox, follow these steps:
- 最好创建一个名为
custom_php.ini
的文件. - 插入两个属性
post_max_size
和upload_max_filesize
并将它们的值设置为所需的上传限制.(就我而言,它是 100M) - 创建一个 ProcFile 并添加这一行
web: vendor/bin/heroku-php-apache2 -i custom_php.ini .
- 将这些更改提交给 Heroku.
- Create a file named
custom_php.ini
, preferably. - Insert two attributes
post_max_size
andupload_max_filesize
and set their value to the desired upload limit. (In my case, its 100M) - Create a ProcFile and add this line
web: vendor/bin/heroku-php-apache2 -i custom_php.ini .
- Commit these changes to Heroku.
我没有在 custom_php.ini
中添加 post_max_size
.通过这种方法,您可以覆盖 Heroku 的任何 php.ini
配置.
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.
这篇关于上传到 Dropbox 时增加 Heroku 中文件上传大小的限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!