Now after fixing the above issue (did a simple insert into the core_config_data table). I uploaded the SVG image, saw it is inside the folder through the console, but could not select it in magento because it was not showing with the other files.
After a bit of searching I found this to be due to ./vendor/magento/module-media-gallery-integration/Plugin/SaveImageInformation.php's afterSave method which saves the record in the media_gallery_asset table.
More specifically the isApplicable was evaluted to false because of the following condition. Here imageExtensions has the formats described in here in addition to the magento's default values.
The issue
Uploading SVG generates an error. And after fixing the error, svg does not show in the list of files displayed.
The setup.
composer show experius/module-wysiwygdownloads
returnsversions : * 1.2.2
andsource : [git] https://github.com/experius/Magento-2-Module-Experius-WysiwygDownloads.git b4be0ae90a11d353bf6110c33dcb3dbbc77945ed
composer require experius/module-wysiwygdownloads
magento setup:upgrade; magento setup:di:compile; magento setup:static-content:deploy -f;
Content
->Pages
->Create/New Page
Insert Image
icon.filename.svg: Disallowed file type.
Details
Does not upload file at all.
It seems that Magento2 uses a config option found under
general/file/protected_permissions
found in file ./vendor/magento/module-media-storage/Model/File/Validator/NotProtectedExtension.php (link leads to magento repo), it has a methodisValid
that is called by ./vendor/magento/module-media-storage/Model/File/Uploader.php'scheckAllowedExtension
.File does not show in the file selection window.
Now after fixing the above issue (did a simple insert into the
core_config_data
table). I uploaded the SVG image, saw it is inside the folder through the console, but could not select it in magento because it was not showing with the other files. After a bit of searching I found this to be due to ./vendor/magento/module-media-gallery-integration/Plugin/SaveImageInformation.php'safterSave
method which saves the record in themedia_gallery_asset
table. More specifically theisApplicable
was evaluted to false because of the following condition. HereimageExtensions
has the formats described in here in addition to the magento's default values.