If you go the /Config folder of your Umbraco installation, then you will find the umbracoSettings.config.
If you open this file you will find the below configuration.
<!-- These file types will not be allowed to be uploaded via the upload control for media and content -->
<disallowedUploadFiles>ashx,aspx,ascx,config,cshtml,vbhtml,asmx,air,axd,swf,xml,html,htm,svg,php,htaccess</disallowedUploadFiles>
Just remove the file extensions that you will allow the user to be able to upload.
Thank you Dennis
- That helped :-) Now all I need it a preview of the file in backend :-)
SVG files can be inserted in HTML just as say PNG or JPG, simply by adding a link to the source, so the Umbraco backend should be able to offer a preview, as it does for other image file types.
Like the Umbraco Logo here on our.umbraco.org it is rendered using SVG:
As SVG is Scalable Vector Graphics you really do not need to "generate" a thumbnail. All you need to do is add a width (and perhaps height) attribute to the the IMG tag showing the preview. You could even just add a class to it "thumbnail" for instance than then scale it using CSS:
The thumbnail preview only works if you have already uploaded all SVG images to the media section. If you leave <imageFileTypes> with SVG option, then when you try to upload an SVG again, Umbraco will try to get image dimensions and will throw an exception.
So currently, you can have SVG images without thumbnail preview in the media section and it will be served as File type, not Image type.
We are waiting for the proper final solution for this, hopefully soon :(
SVG images not showing in media library?
Hi,
I have tried to add a
SVG
file to the media library in Umbraco using the upload feature, however nothing happens: No errors, no file uploaded..I would expect that handling
SVG
to be standard in a modern CMS like Umbraco. Is there a package I need to add to my solution?Also adding multiple media files does also not seem to be handled in a standard Umbraco solution (?).
/Sten
Hi Sten,
If you go the /Config folder of your Umbraco installation, then you will find the umbracoSettings.config.
If you open this file you will find the below configuration.
Just remove the file extensions that you will allow the user to be able to upload.
Hope this helps,
/Dennis
Thank you Dennis - That helped :-) Now all I need it a preview of the file in backend :-)
SVG files can be inserted in HTML just as say PNG or JPG, simply by adding a link to the source, so the Umbraco backend should be able to offer a preview, as it does for other image file types.
Like the Umbraco Logo here on our.umbraco.org it is rendered using SVG:
https://our.umbraco.org/assets/images/logo.svg
/Sten
I agree, SVGs are being used more and more so should be rendered in the backend. Should be particularly easy to generate a thumbnail of, too :)
As SVG is Scalable Vector Graphics you really do not need to "generate" a thumbnail. All you need to do is add a width (and perhaps height) attribute to the the IMG tag showing the preview. You could even just add a class to it "thumbnail" for instance than then scale it using CSS:
/Sten
Yeah, I know Sten - that's why I said it was easy to generate a thumbnail - you literally just change the width and height and it scales :)
If you want thumbnail in Media section for SVG file, just add below code in umbracoSettings.config > Content tag:
<imaging>
<!-- what file extension that should cause umbraco to create thumbnails -->
<imageFileTypes>jpeg,jpg,gif,bmp,png,tiff,tif,svg</imageFileTypes>
</imaging>
Great tip, Bipin - I can confirm that works!
The thumbnail preview only works if you have already uploaded all SVG images to the media section. If you leave
<imageFileTypes>
with SVG option, then when you try to upload an SVG again, Umbraco will try to get image dimensions and will throw an exception.So currently, you can have SVG images without thumbnail preview in the media section and it will be served as File type, not Image type.
We are waiting for the proper final solution for this, hopefully soon :(
Hi Bojan,
SVG preview already works in Umbraco 7.5
http://issues.umbraco.org/issue/U4-8580
Thanks,
Alex
Hi, I've installed v7.5.2 but still getting the same issue as @Bojan. If I take out the
is working on a reply...