Files
The site's files are in its file repository: the folder web/uploads/public/ and a table of its files and folders.
The file repository
Administrators open it with the button «Файловый репозиторий» (File repository) on the admin toolbar, and from the editor's picture and file buttons and the file fields of forms. The window has «Открыть» (Open), «Загрузить» (Upload), «Копировать» (Copy), «Создать папку» (New folder), «Редактировать» (Edit), «Переместить в папку» (Move to folder) and «Удалить» (Delete).
A chosen file is sent at once and kept in uploads/temp/; on save it is copied into its folder under a generated name, while the original name stays as the name of the download and the title is the name without the extension.
- Size. There is no limit of its own: PHP's
upload_max_filesizeandpost_max_sizedecide. - Types. Files that the server would run as programs are refused:
php,php3–php8,phps,pht,phtml,phar,cgi,fcgi,pl,py,sh,htaccessandhtpasswd. Everything else is accepted — HTML and SVG included — and served from the site's own address, so give full rights only to people you trust. - Replacing a file keeps its type: a file of another type is refused.
- Deleting a file that page texts link to asks first and names the pages; links and pictures there would become broken. A folder is deleted with everything in it.
The configuration key thumbnails adds named preview sizes, for example 'small' => ['width' => 140, 'height' => 107], as fields of the file form. repositories.quick_upload_path is the folder of quick uploads from file fields, uploads/public by default. Files copied to uploads/public/ past the admin get into the repository with php index.php setup syncUploads.
Pictures and the resizer
/resizer/w<width>-h<height>/<path> returns a picture of the repository fitted into that box. The editor uses it when a picture's width or height is changed in its window; otherwise a picture in a text is scaled by the browser to the column's width.
- Only JPEG, PNG, GIF and WebP files inside
web/uploads/are resized; anything else answers 404. - The picture is fitted and centred, with white (JPEG, GIF) or transparent (PNG, WebP) padding; small pictures are enlarged; at most 1500 × 1500 pixels, from a source of at most 40 megapixels.
- Results are cached for 30 days in
energine-resizer/in PHP's upload or system temporary folder; browsers getCache-Control,ETagandLast-Modified. - The resizer needs PHP's GD with JPEG, PNG and WebP;
setup checkreports a missing GD as a failure.
nginx sends the resizer's addresses to it with the rule from Installation.