在上传到Dropbox时增加Heroku中文件上传大小的限制 [英] Increase the limit of file upload size in Heroku while uploading to Dropbox
问题描述
在通过Heroku上托管的应用程序将文件上传到保管箱时遇到了问题。我想上传大约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.
我尝试了一次黑客攻击,创建了一个名为 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。 / code>
- 将这些更改提交给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屋!