Just tried to upload an svg file and received error that file type not allowed. Do I just add it to the list shown in the system settings for Uploadable File Types?
-
☆ A M B ☆
- 24,524 Posts
Yes.
You may also need to add it to any Media Sources you are using.
Thanks Susan. So I can just add it at the end of the list?
-
☆ A M B ☆
- 24,524 Posts
Add it anywhere in the list, I always prefer to keep the list in alphabetical order so I can find things quickly. Just watch out for the commas.
Media sources? Not sure at the moment. Just trying to get the file uploaded first. Not even sure I can get svg with a png fall back to work.
-
☆ A M B ☆
- 24,524 Posts
A Media Source comes with an imageExtensions property, set to jpg,jpeg,png,gif
so you would need to add your svg extension. That includes the default Filesystem media source. I'm not sure if the System Setting will override these Media Source settings when using the default Filesystem media source.
I think I understand. Like with a TV? If I select an image using a TV, it needs to understand what kind it is... jpg, gif, etc. etc. Is that what you mean?
If I attempt to do this svg thing with a png fallback, I will most likely hard code it, with no option for the client for modify or change, just because there are so many steps involved with generating the svg and setting up the link and fallback code that the average user would not be able to figure it out. I'm even having a hard time figuring it out at the moment and got stuck on the very first step: Uploading the svg to the server. Ha!
I looked for media sources. Found an item that listed Redactor. So is something like that what you're referring to? Like whatever the media source is, it would need to understand svg file type in order for it to be used in conjunction with it. Like if I linked to an image from within a redactor text editor?
For now, I hard coded my link and the svg looks awesome on screen. Now just need to refine size and placement using CSS, and insert a fallback script to load a png alternate if svg not supported on the device.
-
☆ A M B ☆
- 24,524 Posts
No. Tools -> Media Sources. Probably the only one you'll see is the default Filesystem, which you shouldn't need to worry about.
-
☆ A M B ☆
- 24,524 Posts
Update for 2.3 - Media Sources are now in Media->Media Sources.
To be able to upload svg files, you need to add it to the long list in the System Settings for upload_files, and possibly also upload_images.
Adding svg to the imageExtensions field of a Media Source, including the default Filesystem source, allows it to be displayed from the file tree in the Files tab.
However, MODX does not seem to be able to generate thumbnails for them to use in TVs and viewing a list of images in a folder.