Skip to the content
Documentation

Setting up multi-upload

No ratings yet

This page is for administrators. The upload page comes with the extension ezmultiupload, which Exponential 6 installs and a new installation activates. The Admin 4 designs draw the full page with quick locations, the queue and ZIP import; the classic admin design keeps a lighter page that works with the same server.

Switch it on

  1. Activate the extension in settings/override/site.ini.append.php, if it is not active yet.
  2. Give the roles that upload access to the module ezmultiupload. The module has no functions of its own, so the policy grants the whole module. The users also need content/create for the item types the files become, in the places they upload to.
  3. Regenerate the autoloads and clear the caches.
[ExtensionSettings]
ActiveExtensions[]=ezmultiupload
php bin/php/ezpgenerateautoloads.php -e
php bin/php/ezcache.php --clear-tag=ini
php bin/php/ezcache.php --clear-tag=template

The page is ezmultiupload/upload/<node id> in the administration. Which type of item a file becomes is decided by upload.ini [CreateSettings] MimeClassMap[]: images become Image, anything else the DefaultClass, usually File. SVG images become images too and are cleaned when they are stored.

The settings

All in ezmultiupload.ini; override them in settings/override/ezmultiupload.ini.append.php. Setup > INI settings shows the values in effect and the file each comes from.

The settings view of ezmultiupload.ini

Setup > INI settings shows the settings of ezmultiupload.ini as they are in effect, and the file each value comes from.

Block Setting Shipped value Meaning
MultiUploadSettings AnyContainer enabled Every container the user may create content in takes uploads. disabled keeps the older rule: only the classes of AvailableClasses[] and the subtrees of AvailableSubtreeNode[].
MultiUploadSettings AvailableClasses[] folder, gallery The classes that take uploads when AnyContainer is disabled.
MultiUploadSettings AvailableSubtreeNode[] (empty) Node IDs of subtrees that take uploads when AnyContainer is disabled.
MultiUploadSettings MaxFileSize 64M The largest file. PHP's upload_max_filesize and post_max_size apply too; the smallest of them is the limit.
FileTypeSettings_folder FileType[] *.* The file types a folder takes.
FileTypeSettings_gallery FileType[] *.jpg, *.png, *.gif, *.flv, *.mp4, *.mov, *.svg, *.svgz and more The file types a gallery takes. A block [FileTypeSettings_<class or node id>] sets them for another class or subtree.
QuickLocationSettings QuickLocations, PresetList[], ChildRowList[], ChildRowLimit enabled; content, media, media/images, media/files; content, media; 12 The quick location buttons: the first row, the places that get a row of the locations right below them, and how many buttons a row shows before More....
DashboardSettings UploadTargetList[] media/images, media Where Upload files on the dashboard opens the page: the first of these places the user can upload to.
ZipSettings ZipImport, MaxEntries, MaxTotalSize, MaxDepth, FolderClass enabled, 1000, 500M, 3, folder The ZIP import and its limits; system files such as __MACOSX and .DS_Store are left out.

Security

  • Every request that changes something is a POST that carries the session's form token. A location or item the user cannot read is answered as if it did not exist.
  • Before a file is sent, the server checks the class, the create permission there, the type list, the size and the alternative text. It checks them again when the file arrives.
  • Moving, adding a location and removing from the Uploaded list use the same permission checks as the content structure. An item with items below it is not removed there.

What can go wrong

  • Files over a few megabytes fail. PHP's upload_max_filesize or post_max_size is lower than MaxFileSize. Raise them in the PHP settings of the site.
  • A place says uploads are not allowed. AnyContainer is disabled and the class is not listed, or the user may not create the item types there.
  • Uploaded items have no link to their page. A workflow that holds publishing, such as an approval, has stopped them. They appear when they are approved.

Read more

  • Uploading many files at once, for editors.
  • The full description of the page, with every option: extension/ezmultiupload/doc/upload-page.md in the installation.

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.