-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to upload SVG images for categories #3064
Comments
Look in filemanager.php at line: 234 and 245 Settings has nothing to do with the upload in filemanager. |
I did look into this a bit further and did find those lines in filemanager.php. I've added 'svg' and 'image/svg+xml' to the $allowed array, however, it goes a bit deeper than that. Doing this allowed the uploading of SVGs however the images don't display in the admin panel properly. I assume that the image resizing is failing because it's not a file type that OpenCart supports properly, so to work around the issue I'm modifying template files such as \admin\view\template\common\filemanager.tpl and \admin\view\template\catalog\category_form.tpl with code like: As it doesn't copy the SVG to /image/cache/catalog/ with '-100x100' in the file name, I'm simply removing those parts so the image path is legitimate. I know that this isn't the most ideal way to work around the issue, however I'm not very familiar with how OpenCart is put together. |
svg is not the same as jpg, png so no it wont work and its not a bug! @GomDani dont give advise unless you know what you are doing. |
Hi Daniel, I understand if this isn't considered a bug, but given that SVGs are important for mobile design on devices with retina displays, could this perhaps be a feature request for a future release? |
Using OpenCart 2.0.1.1, I receive the following error when attempting to upload an SVG image as a product category image:
SVGs are allowed in 'Allowed File Extensions' and 'Allowed File Mime Types' within the Server options (I have not modified this from the default installation):
I've double checked that the MIME type of my SVG image is image/svg+xml.
The text was updated successfully, but these errors were encountered: