File Upload Limit

When things doesn't work as they should.
User avatar
Posts: 211
Joined: Tue Aug 21, 2018 3:28 am

Re: File Upload Limit

Post by rosarior » Sat Apr 13, 2019 12:03 am

Version 3.1.10 was released and includes a new setting to lower memory usage at the expense of MIME type detection. The mode in which we use the MIME type library, the entire file needs to be loaded into memory in order to the properly introspected.

We added the setting MIMETYPE_FILE_READ_SIZE to limit the number of bytes that are read. The default value of 0 causes Mayan to read the entire file in other to keep the current behavior. Set MIMETYPE_FILE_READ_SIZE to a number other than 0 to reduce the amount of the file that is read into memory. A number of 1024 is a good compromise as most magic numbers used to identify files are in the first bytes of the file. So far only the detection of .docx gets affected using a number other than 0 since .docx files are actually a compressed set of XML files and the magic numbers of compressed files are not necessarily at the start of the file. ... mory-usage

We are tying to come up with a long term solution for 100% of the cases without sacrificing detection. Out best idea is using something like a custom file object class that with buffered emitter to allow loading the entire file one block at a time. This is an ongoing research.

Post Reply