Closed viktorcsimma closed 1 month ago
With the naming, you are right; what about putting it into the general
config file as something like "general file size limit"?
Bytes seem to be logical to me because the size
attribute expects bytes; those have also been used earlier for printer file size limits.
I think it would be nice to make it configurable if we could, but I don't insist on it. WDYT?
I'm not insisting on changing the unit of measurement, just found the proposed changes quite confusing.
On the one hand, yes, it is used in the size
attribute. But does the size
attribute have any effect? I think according to the HTML5 specification the size
attribute is ignored in cases where <input type="file">
is used.
If you want to change the scope of this PR by implementing a general file size limit, please note that in cases where the file size limit is larger than a reverse proxy's size limit, it should return with an error code of 413 and not pass the request to the PHP interpreter.
I see... so should we include a comment on this limitation in .env.example?
Until then, I'll simply remove the size
attributes; thanks for pointing that out.
But as the printer's file upload limit is set in bytes, I would also use bytes on this PR. So yeah, changing the units of measurements is not necessary, I think it would be out of scope of this PR. (If I were the author, I would open a separate PR for changing the unit of measurement and drop the unnecessary size
attributes.)
So should we have a small, immediately mergeable PR that just raises the limits until then?
Okay; thank you:)
Now, it is not limited to 2 MB, but a limit can be given in
.env
(the default is 10 MB = 10 000 000 B).This applies to language exam files and profile pictures, too. In the future, these could be separated to different
.env
entries.And as an additional nicety, language exam files are new opened on a new tab.