Normally, default server configuration does not allow to upload files with Image Uploader. This topic describes how to configure a server you are going to deploy Image Uploader on properly.
The folder where you are going to save files should have modify permissions. Depending on your operating system it can be set in one of the following ways:
Usually, a limitation for maximum POST request length is specified to reduce the risk of DoS attacks. If the request size exceeds a specific value, it is considered malicious and the upload would be broken.
To increase the limit of the maximum upload size, you should edit your PHP configuration files:
Open the php.ini
file. You can find it:
/etc/php.ini
c:\windows\php.ini
Set the required limits:
post_max_size = 100MB upload_max_filesize = 100MB
Additionally, you can set the following parameters:
max_file_uploads
, the maximum number of files allowed to be uploaded in a single HTTP POST request. This value should be not less than number of user-selected files multiplied by converters number. If you are not sure what value to set, you can:
500
.max_file_uploads
should be not less than MaxFileCount * converters number.max_file_uploads
not less than FilesPerPackage * converters number.memory_limit
, the maximum amount of memory in bytes that a script is allowed to allocate.upload_tmp_dir
, the temporary directory used for storing files when doing file upload.max_execution_time
, the maximum time in seconds a script is allowed to run before it is terminated by the parser.To make sure that new settings are applied, use the phpinfo() function which outputs information about the current state of PHP.
<?php phpinfo(); ?>
If you use the Apache web server, you should also edit the php.conf
file:
Open the php.conf
file. You can find it:
/etc/httpd/conf.d/php.conf
<Apache installation folder>\conf\php.conf
Change the LimitRequestBody
parameter according to the
post_max_size
value, e.g.:
LimitRequestBody 104857600
Do not forget to restart your server after modifying its configuration.
If you use the IIS web server, you should follow one of the next configurations.
Go to C:\Windows\System32\inetsrv\config\applicationHost.config
and change
<section name="requestFiltering" overrideModeDefault="Deny" />
to:
<section name="requestFiltering" overrideModeDefault="Allow" />
Add to your application's web.config
the following sections:
<system.webServer> <security> <requestFiltering> <requestLimits maxAllowedContentLength ="2147482624" /> <!-- in bytes --> </requestFiltering> </security> </system.webServer>
<system.web> <httpRuntime maxRequestLength="2097151"/> <!-- in kilobytes --> </system.web>
Add to your application's web.config
the following section:
<system.web> <httpRuntime maxRequestLength="2097151"/> <!-- in kilobytes --> </system.web>
If you have URLScan installed and still experience this problem, go through the following steps:
UrlScan.ini
file which is typically located at C:\Windows\system32\inetsrv\urlscan
folder.Do not forget to restart your server after modifying its configuration.