Loading...
 
Skip to main content

History: Why File Uploads May Fail

Source of version: 7 (current)

Copy to clipboard
            !Why File Uploads May Fail

File uploads may fail from time to time, especially when uploading large files (>20MB). The following is a list of common settings and configurations that can be the cause:

!!!PHP Memory Limit

Tiki loads the uploaded file into memory to do search indexing, typing, and sizing of the tiles. The  [http://php.net/manual/en/ini.core.php#ini.memory-limit|memory_limit] setting in PHP can be increased to prevent these steps from crashing your PHP process. You can see your current memory_limit with the tiki-phpinfo.php file (see  [/Phpinfo|PHPInfo]). Try raising this setting to 512MB.

!!!PHP Upload Max Filesize

TIki should tell you directly if you are trying to upload a file that exceeds the PHP configuration, but in case it does not, check the upload_max_filesize  setting ([/Phpinfo|PHPInfo]). Increase this settings as is appropriate for your limits.

!!!PHP Max Post Limit

If your file size exceeds the post_max_size variable, then PHP will strip all the POST data. Make sure that this setting is greater than upload_max_filesize.

!!!Storing files in a MySQL database

Tiki can store its uploaded files in the database in a LONGBLOB field. Storing large amounts of data in a database row can be tricky and require some fine tuning of your database parameters. You may want to switch to local disk storage as a first option.

#Go to Settings -> Control Panel -> File Galleries
#Change Storage to "Store in Directory"
#Set the "Path to store files in the file gallery" field
#Click "Apply"

{img type="attId" attId="74" width="300" responsive="y"}

You can also try to fix the problem with the database storage. If you are using database storage for large files and you are using MySQL's  INNODB engine,  you could be getting an error like "Row size too large". If so, try the following:

1. Add the following to the my.cnf file under [mysqld] section.

{CODE()}innodb_file_per_table
innodb_file_format = Barracuda{CODE}

2. ALTER the table to use ROW_FORMAT=COMPRESSED.

{CODE()}
ALTER TABLE nombre_tabla
    ENGINE=InnoDB
    ROW_FORMAT=COMPRESSED 
    KEY_BLOCK_SIZE=8;
{CODE}

__Note: It is not recommended to store more files more than 100MB in a database__