V8-archive: Add php max upload size to htaccess

Created on 28 Feb 2019  路  5Comments  路  Source: directus/v8-archive

Feature Request

Apparently a couple server types (LAMP stacks too) support setting php values in .htaccess. It could be beneficial for Directus to set a default max upload size on the projects .htaccess, to make sure the user isn't limited by the default 2MB upload size

How do you think this should be implemented?

Add

php_value upload_max_filesize 50M
php_value post_max_size 100M

to the .htaccess file in /public

What would be the ideal default upload size?

enhancement

Most helpful comment

Hi, I'm not sure if this change made was the best idea on a devops perspective as it overwrites the setting made in the server configurations php.ini ... so it is harder to automate, monitor, debug ...

Even if it is a good idea to somehow increase the defaults it just makes things more complicated when I wanna customize the setting using the php.ini because now I have some settings which do not have the desired effect anymore and I have to handle stuff on two sides, the php.ini and the .htaccess which just leads to a different kind of inconvenience and is less reliable as I don't know if these defaults will be changed in a future release or not and so on ...

For me this possibility belongs to the docs but not as a default setting in the .htaccess. It may be a good idea to keep it in the .htaccess as a commented-out suggestion.

All 5 comments

Seems like a sensible default -- I think the only use-case for higher limit would be video.
50MB is probably enough for a 3-4 minute video clip.

Closed out in pull #805

Hi, I'm not sure if this change made was the best idea on a devops perspective as it overwrites the setting made in the server configurations php.ini ... so it is harder to automate, monitor, debug ...

Even if it is a good idea to somehow increase the defaults it just makes things more complicated when I wanna customize the setting using the php.ini because now I have some settings which do not have the desired effect anymore and I have to handle stuff on two sides, the php.ini and the .htaccess which just leads to a different kind of inconvenience and is less reliable as I don't know if these defaults will be changed in a future release or not and so on ...

For me this possibility belongs to the docs but not as a default setting in the .htaccess. It may be a good idea to keep it in the .htaccess as a commented-out suggestion.

I agree @mimamuh, I have a step in my CI that removes this for my client projects.

@directus/api-team?

I am sending a PR #1145

Was this page helpful?
0 / 5 - 0 ratings

Related issues

maettyhawk picture maettyhawk  路  3Comments

gitlabisbetterthangithub picture gitlabisbetterthangithub  路  3Comments

magikstm picture magikstm  路  3Comments

andgar2010 picture andgar2010  路  3Comments

rijkvanzanten picture rijkvanzanten  路  3Comments