-
Notifications
You must be signed in to change notification settings - Fork 11
Setup: Upload
dante di domenico edited this page Jun 12, 2024
·
2 revisions
Upload settings can be set by uploadAccepted
, uploadForbidden
and uploadMaxResolution
configurations in config/app_local.php
(or in config/projects/<projectName>.php
if you use multi project configuration).
I.e.:
'uploadAccepted' => [
// ...
],
'uploadForbidden' => [
// ...
],
'uploadMaxResolution' => '1920x1080',
uploadAccepted
is used to specify mime types accepted per object type, in form upload input files.
In the following example, input file accepts:
-
audio/*
for objects of typeAudio
-
image/*
for objects of typeImages
-
video/*
for objects of typeVideos
'uploadAccepted' => [
'audio' => [
'audio/*',
],
'images' => [
'image/*',
],
'videos' => [
'video/*',
],
],
uploadForbidden
configuration is used to forbid from upload specific mime types and/or file extensions.
I.e.:
'uploadForbidden' => [
'mimetypes' => [
'application/javascript',
'application/x-cgi',
'application/x-perl',
'application/x-php',
'application/x-ruby',
'application/x-shellscript',
'text/javascript',
'text/x-perl',
'text/x-php',
'text/x-python',
'text/x-ruby',
'text/x-shellscript',
],
'extensions' => [
'cgi',
'exe',
'js',
'perl',
'php',
'py',
'rb',
'sh',
],
],
uploadMaxResolution
is used to set the maximum resolution for images uploaded.
In the following example, the maximum resolution is set to 1920x1080
.
'uploadMaxResolution' => '1920x1080',