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 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). 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). 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.

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


Image

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.

Copy to clipboard
innodb_file_per_table innodb_file_format = Barracuda


2. ALTER the table to use ROW_FORMAT=COMPRESSED.

Copy to clipboard
ALTER TABLE nombre_tabla ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;


Note: It is not recommended to store more files more than 100MB in a database