1. Home
  2. General info
  3. Adjust the allowed size for saving the files content in database

Adjust the allowed size for saving the files content in database

By default the application will save in database the contents of the files only if these weight less than 512KB.
If you want to increase the size to 1MB for example, you can adjust this by opening the app/config/custom.php file and look for:

    'params' => [
        'fm' => [
            'encryptionKey' => '....',
        ]
    ],

Once you find it, make it look like:

    'params' => [
        'fm' => [
            'encryptionKey' => '....',
            'maxFileSizeStore'   => 1048576, // 1MB -> size is in bytes
        ]
    ],

Please note that you have to take into consideration your MySQL database server setting for max_packet_size, which by default is 1MB so if you will send more data to the server than 1MB you’ll get various errors. In this case you have to raise the limit from 1MB to more in your my.cnf config file for the MySQL server.

If you want to disable content saving to database, just set it to 0:

    'params' => [
        'fm' => [
            'encryptionKey' => '....',
            'maxFileSizeStore'   => 0,
        ]
    ],

Was this article helpful?

Related Articles