Menu


How to upload large files


TYPO3 has a default limitation on how big the files you try to upload can be. This limitation is 2 MB on default installs and can be up to 10 MB depending on your settings and PHP configuration.

You can override these default limitations and can upload very big files. We will deal here with examples for a 100 MB file.

Factors that influence the size of files you can upload:

Apache PHP module configuration


Apache's PHP module has a limit usually in /etc/httpd/conf.d/php.conf (depends on your installation). You can change there the "LimitRequestBody" to the size you wish otherwise you might get a "connection reset" error message.

Modification of the PHP configuration


PHP also restricts the maximum filesize. You can change this either by modifying the php.ini file, either by adding configuration directives to the .htaccess file.

php.ini settings:


 ;;;;;;;;;;;;;;;;;;;
 ; Resource Limits ;
 ;;;;;;;;;;;;;;;;;;;
 
 max_execution_time = 1000     ; Maximum execution time of each script, in seconds
 max_input_time = 1000 ; Maximum amount of time each script may spend parsing request data



 ; Maximum size of POST data that PHP will accept.
 post_max_size = 100M



 ; Maximum allowed size for uploaded files.
 upload_max_filesize = 100M



Doing this from .htaccess would look like:


 php_value max_execution_time 1000
 php_value max_input_time 1000
 php_value post_max_size 100M
 php_value upload_max_filesize 100M



Beware in this case because modifying these settings from .htaccess could be forbidden. One can forbid/allow modifications of these values in httpd.conf



TYPO3 Configuration


You can modify TYPO3's configurations for filesize in two ways: either by Install Tool either by localconf.ph (in fact both do the same thing, the first is user friendlier)

Via Install Tool


In the All Configuration section search for maxFileSize. This setting can be adjusted to whatever value you wish after you completed the previous steps.

Via localconf.php


set the following configuration to enable 100 MB uploads.

 $TYPO3_CONF_VARS['BE']['maxFileSize'] = '100000';




Additional settings


$TCA-parameters


A few TYPO3 content elements have their own restrictions regarding the maximum upload size. One can change these by editing the TCA configuration for these fields

You can do this in the following ways:


* Through editing ext_tables.php of the extension in typo3conf/ext/.
* or create a new extension and add the code to the file ext_tables.php.
* or open the file extTables.php in folder typo3conf/.
Make sure that this file gets included by the following line in typo3conf/localconf.php:

 $typo_db_extTableDef_script = 'extTables.php';



No matter how you do it from the above ways you must this code into the extTables file


 t3lib_div::loadTCA('tt_content');
 // This changes the upload limit for image elements
 $TCA['tt_content']['columns']['image']['config']['max_size'] = 100000;
 
 // This changes the upload limit for media elements
 $TCA['tt_content']['columns']['media']['config']['max_size'] = 100000;
 
 // This changes the upload limit for multimedia elements
 $TCA['tt_content']['columns']['multimedia']['config']['max_size'] = 100000;


Do not forget to clear the cache after you perform these updates.







Google Search

 
wiki.lacisoft.com
WWW
2009-2011 (c) Lacisoft.com