Server configuration

The server configuration encompasses parameters that directly related to the directory structure on the server and to various limitations stipulated mostly by security.
All other parameters are configured on the widget side.
Note that we have a dedicated material describing information security. That article thoroughly describes many parameters in terms of unauthorized access prevention.

The list of server side parameters

dirFiles: string
Specifies the path to a directory where uploaded files will be stored. Depending on the server (PHP, Java, etc.) various relative paths are possible, so to avoid discrepancies, we recommend using an absolute path in this and other parameters specifying the path to the directory.
dirTmp: string
Sets the path to a temporary directory. This directory is actively used by the transaction mechanism of File Uploader. It is this directory where the uploaded files stay until they are committed (moved to the dirFiles directory). After commit, files are deleted from the dirTmp directory, but this can be prevented with the keepUploads option.
keepUploads: boolean
Default value: false
Available values: true, false
If you set false to this parameter, all uploads (cancelled and committed) will be saved to the dirTmp directory until you delete them manually.
allowedExtensions: string
Default value: ""
The comma-separated list of extensions allowed for uploading to the server. If the parameter is not set or is empty, any extensions are allowed.
jpegQuality: number
Default value: 95
JPEG quality used to save resized images. 1 - lowest quality, minimum size, 100 - best quality, maximum size. Set this parameter depending on how you want images to display on the website. Don't worry about possible future resizes: to prevent manifold quality losses due to compression, File Uploader saves the original image using the "-original" suffix in the background whenever the main image is modified for the first time. It is this copy of the original that will be used for further resizes.
maxUploadFileSize: number
Default value: 0
Maximum file size (in bytes) allowed for upload. This limit applies only to files that a user uploads to the server and does not apply to files being edited. Therefore, if the user sets the size of the image larger than the original, the file will take more disk space, but the limit will not apply.
maxImageResizeWidth, maxImageResizeHeight: number
Default value: 5000, 5000
The maximum allowed target size for resize. If at least one value (height or width) exceeds this threshold in the request of the widget, the server refuses the attempt to resize the image. This limitation is used to prevent unnecessary load to the server either malicious (DDoS) or occasional.
crossDomainUrl: string
Default value: ""
This parameter allows you to execute the server script of the uploader from another domain that is different from the domain of the uploader. This means you must set this parameter if your widget works on one website, while the server part of File Uploader is located on another website. You can set this parameter to *, which will allow the widget to normally function from any website, or specify a specific domain, for example http://mywebsite.com

Example of server configuration

Depending on the server, there are various formats of parameter values. For example, in PHP all settings are configured in config.php. Here is an example of configuration that sets uploaded file limits and allowed extensions, and defines the main upload directory:

$config['allowedExtensions'] = 'jpeg,jpg,png,gif,zip,pdf';
$config['maxFileSize'] = 14000000;
$config['baseDir'] = '/var/www/images/';

In order to learn where and how to specify settings of the server part of File Uploader, please refer to the corresponding section of the uploader installation article.