# הוסף את סיומת הקובץ .svg ל"קבצי תמונה"

**URL:** https://meta.discourse.org/t/add-the-svg-file-extension-to-image-files/212333
**Category:** Feature
**Created:** [16 בדצמבר,‏ 2021,‏ 5:32pm UTC](https://meta.discourse.org/t/add-the-svg-file-extension-to-image-files/212333 "2021-12-16T17:32:50Z")
**Posts on this page:** 19
**Page:** 1

<div class="post-metadata">

### Author: ![Ondrashek06](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ondrashek06/32/185884_2.png) [@Ondrashek06](https://meta.discourse.org/u/Ondrashek06)
#### Post date: [16 בדצמבר,‏ 2021,‏ 5:32pm UTC](https://meta.discourse.org/t/add-the-svg-file-extension-to-image-files/212333/1 "2021-12-16T17:32:50Z")

</div>

One Discourse forum that I use has the default setting to only allow “image files”, however .svg files say that they are “not authorized”, while .svg files are images, just vector ones instead of raster ones, that means they can be scaled without losing quality. Also, the sizes are comparable too, if not smaller, when I converted a .png to a .svg:

- The .png file had 8190 bytes.
- The .svg file had 4273 bytes.

So is there any reason as to why a .svg file isn’t treated as an image file?

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [16 בדצמבר,‏ 2021,‏ 5:57pm UTC](https://meta.discourse.org/t/add-the-svg-file-extension-to-image-files/212333/2 "2021-12-16T17:57:33Z")

</div>

An admin sets the accepted file types. Svg isn’t in there by default, but it can be added from the `authorized_extensions` setting. If you ask your admin, they may consider it?

 ![authorised extensions](https://global.discourse-cdn.com/meta/original/3X/1/2/124c999e0b94d923117e33f4f3399cb22d823794.jpeg)

---

<div class="post-metadata">

### Author: ![Ondrashek06](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ondrashek06/32/185884_2.png) [@Ondrashek06](https://meta.discourse.org/u/Ondrashek06)
#### Post date: [17 בדצמבר,‏ 2021,‏ 7:47am UTC](https://meta.discourse.org/t/add-the-svg-file-extension-to-image-files/212333/3 "2021-12-17T07:47:28Z")

</div>

Problem is, the admins ignore direct messages, quoting one:

 ![Screenshot_2021-12-17-08-46-34](https://global.discourse-cdn.com/meta/original/3X/0/7/0793c3b2e99f11703af0c9fcfb67866474c9c7be.jpeg)

And they ignore 99.9% of the threads on the forums.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [17 בדצמבר,‏ 2021,‏ 8:20am UTC](https://meta.discourse.org/t/add-the-svg-file-extension-to-image-files/212333/4 "2021-12-17T08:20:09Z")

</div>

Is there a #Contribute > Site feedback category that you can make those kinds of requests in? Or maybe contact them from the email address on the forum’s `/about` page?

---

<div class="post-metadata">

### Author: ![mattdm](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mattdm/32/216484_2.png) [@mattdm](https://meta.discourse.org/u/mattdm)
#### Post date: [17 בדצמבר,‏ 2021,‏ 11:24pm UTC](https://meta.discourse.org/t/add-the-svg-file-extension-to-image-files/212333/5 "2021-12-17T23:24:06Z")

</div>

Isn’t this a potential security risk, unless the file is sanitized?

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [18 בדצמבר,‏ 2021,‏ 8:10am UTC](https://meta.discourse.org/t/add-the-svg-file-extension-to-image-files/212333/6 "2021-12-18T08:10:27Z")

</div>

I’m afraid I don’t know the full answer to that, but I think discourse does some checking as part of the upload?

> <https://github.com/discourse/discourse/blob/ce686a008f97708099efbe9969d1a83f8b8950cf/lib/upload_creator.rb#L9-L13>

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [18 בדצמבר,‏ 2021,‏ 9:55am UTC](https://meta.discourse.org/t/add-the-svg-file-extension-to-image-files/212333/7 "2021-12-18T09:55:58Z")

</div>

> [@Ondrashek06](#):
>
> Problem is, the admins ignore direct message

That’s not a problem that can be solved here. If you don’t like how the forum is run, then don’t use it or start your own.

---

<div class="post-metadata">

### Author: ![roke\_julian\_lockhart](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roke_julian_lockhart/32/540179_2.png) [@roke\_julian\_lockhart](https://meta.discourse.org/u/roke_julian_lockhart)
#### Post date: [8 באוקטובר,‏ 2025,‏ 1:16pm UTC](https://meta.discourse.org/t/add-the-svg-file-extension-to-image-files/212333/8 "2025-10-08T13:16:57Z")

</div>

@pfaffman, I believe that it is: sensible defaults mean less duplication of effort. I could ask all administrators to enable SVG upload, as others have:

> **[Supporting SVG image upload](https://discourse.haskell.org/t/supporting-svg-image-upload/10144)**
>
> The list of supported file types for image uploading appears not to contain any vector formats. Can SVG be added? (I’d like to stop relying on third-party services which may not work for everyone when making posts like...

> **[Why can't I upload an SVG?](https://discourse.webflow.com/t/why-cant-i-upload-an-svg/187540)**
>
> Why can’t I upload any SVG files? Is there a workaround to this? Here is my site Read-Only: LINK (how to share your site Read-Only link)

> <https://meta.stackexchange.com/questions/92568/allow-svg-image-uploads>

> ****
>
> > **[Easy way to link SVGs in forum posts](https://community.glowforge.com/t/easy-way-to-link-svgs-in-forum-posts/46740)**
> >
> > Sometimes, adding a “clickable” link is nice for new users. Not everyone gets the concept of right click, save as… I linked to an existing SVG in a thread here: How I did it: Right click on the uploaded SVG, select “copy image location”. ...

…or I could ask Meta to set it as a default. On that point, I agree with @Ondrashek06.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [8 באוקטובר,‏ 2025,‏ 1:36pm UTC](https://meta.discourse.org/t/add-the-svg-file-extension-to-image-files/212333/9 "2025-10-08T13:36:05Z")

</div>

> [@roke\_julian\_lockhart](#):
>
> or I could ask Meta to set it as a default

Well, 4 years later and I’m in complete agreement!

Here, I’ll see if I can make it so:

[https://github.com/discourse/discourse/pull/35282](https://github.com/discourse/discourse/pull/35282)

---

<div class="post-metadata">

### Author: ![roke\_julian\_lockhart](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roke_julian_lockhart/32/540179_2.png) [@roke\_julian\_lockhart](https://meta.discourse.org/u/roke_julian_lockhart)
#### Post date: [8 באוקטובר,‏ 2025,‏ 2:30pm UTC](https://meta.discourse.org/t/add-the-svg-file-extension-to-image-files/212333/10 "2025-10-08T14:30:45Z")

</div>

@pfaffman, thank you!

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [8 באוקטובר,‏ 2025,‏ 2:31pm UTC](https://meta.discourse.org/t/add-the-svg-file-extension-to-image-files/212333/11 "2025-10-08T14:31:52Z")

</div>

There’s some likelihood that there’s a reason that I don’t understand that makes it a Bad Idea to include it by default. 🤷

---

<div class="post-metadata">

### Author: ![roke\_julian\_lockhart](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roke_julian_lockhart/32/540179_2.png) [@roke\_julian\_lockhart](https://meta.discourse.org/u/roke_julian_lockhart)
#### Post date: [8 באוקטובר,‏ 2025,‏ 2:52pm UTC](https://meta.discourse.org/t/add-the-svg-file-extension-to-image-files/212333/12 "2025-10-08T14:52:46Z")

</div>

@pfaffman, I’d _presume_ sanitisation, because it’s a very powerful format. However, considering that _inline_ HTML is supported, and other forums support SVGs, it’s definitely not insurmountable, especially because they appear to be permitted here:

> [@SVG uploads displayed too small](https://meta.discourse.org/t/svg-uploads-displayed-too-small/180283/3):
>
> Thanks! Here’s what that that particular example graphic looks like here (that’s not a bit of dirt on your screen, it’s the rendered graphic): [e1ff136dadb082718c04bb5aaf0f1395de79ba93] I see exactly the same 12x8 pixel size inferred here; here’s the raw markdown exactly as shown from uploading this file, without any changes: ![e1ff136dadb082718c04bb5aaf0f1395de79ba93|12x8](upload://wffVySQ30j5UczxrY5nifKC0kEP.svg) Changing the inferred size from 12x8 to 480x320 makes the image visible a…

> ****
>
> To demonstrate, the undermentioned is an SVG:
> 
> ![](https://global.discourse-cdn.com/meta/original/4X/0/9/0/09034e7a798abd5bf9ab2648214255c15d7f36e1.svg)

---

<div class="post-metadata">

### Author: ![mcdanlj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcdanlj/32/131829_2.png) [@mcdanlj](https://meta.discourse.org/u/mcdanlj)
#### Post date: [8 באוקטובר,‏ 2025,‏ 3:43pm UTC](https://meta.discourse.org/t/add-the-svg-file-extension-to-image-files/212333/13 "2025-10-08T15:43:26Z")

</div>

So…

SVG is sanitized.

At the time I read the code, my judgement was that the sanitization was actually fairly robust, and that gave me confidence to enable it on my site.

I can understand if CDCK doesn’t want the responsibility of making that call for everyone, particularly since the sanitized SVG doesn’t meet all needs for SVGs. For example, on my site, sometimes people post SVGs intended for laser cutting, and occasionally the modifications applied in that sanitization have silently broken them for that purpose.

So I understand reluctance to just enable it by default, even though it was a minor annoyance to me when I was doing configuration.

---

<div class="post-metadata">

### Author: ![roke\_julian\_lockhart](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roke_julian_lockhart/32/540179_2.png) [@roke\_julian\_lockhart](https://meta.discourse.org/u/roke_julian_lockhart)
#### Post date: [8 באוקטובר,‏ 2025,‏ 5:39pm UTC](https://meta.discourse.org/t/add-the-svg-file-extension-to-image-files/212333/14 "2025-10-08T17:39:35Z")

</div>

@mcdanlj, Blender, presumably via a plugin, allows file uploads. That’s inapplicable as a default, but may assist your forum, because your SVGs are primarily for uses other than inline rendering.

---

<div class="post-metadata">

### Author: ![mcdanlj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcdanlj/32/131829_2.png) [@mcdanlj](https://meta.discourse.org/u/mcdanlj)
#### Post date: [8 באוקטובר,‏ 2025,‏ 7:09pm UTC](https://meta.discourse.org/t/add-the-svg-file-extension-to-image-files/212333/15 "2025-10-08T19:09:30Z")

</div>

In my case, we want both behaviors from time to time… So we’d have people upload a ZIP file where it’s important that we’re looking at a byte-perfect file. Nine times out of ten, it’s more useful for us to just see it online without downloading, even with the sanitization.

(Yes, we would love to have our cake and eat it too! 🤣)

---

<div class="post-metadata">

### Author: ![roke\_julian\_lockhart](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roke_julian_lockhart/32/540179_2.png) [@roke\_julian\_lockhart](https://meta.discourse.org/u/roke_julian_lockhart)
#### Post date: [8 באוקטובר,‏ 2025,‏ 7:27pm UTC](https://meta.discourse.org/t/add-the-svg-file-extension-to-image-files/212333/16 "2025-10-08T19:27:09Z")

</div>

@mcdanlj, I’m not confident that rendering unsanitised, inline SVGs is even theoretically feasible. 😅

---

<div class="post-metadata">

### Author: ![mcdanlj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcdanlj/32/131829_2.png) [@mcdanlj](https://meta.discourse.org/u/mcdanlj)
#### Post date: [9 באוקטובר,‏ 2025,‏ 1:48am UTC](https://meta.discourse.org/t/add-the-svg-file-extension-to-image-files/212333/18 "2025-10-09T01:48:55Z")

</div>

I didn’t mean that; unsanitized inline SVGs are a CSS attack vector.

I meant being able to choose at upload time whether it should be sanitized into a display SVG or left unrendered as an upload. But actually even more perfect would be sanitized inline display, but if you click download you get the original unsanitized version.

This is not a serious feature suggestion. it’s just what would be perfect for one weird use case. 😃

---

<div class="post-metadata">

### Author: ![roke\_julian\_lockhart](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roke_julian_lockhart/32/540179_2.png) [@roke\_julian\_lockhart](https://meta.discourse.org/u/roke_julian_lockhart)
#### Post date: [9 באוקטובר,‏ 2025,‏ 10:21am UTC](https://meta.discourse.org/t/add-the-svg-file-extension-to-image-files/212333/19 "2025-10-09T10:21:15Z")

</div>

@mcdanlj, because, I _believe_ a plugin is what provides Blender’s file upload capabilities, if that’s true for you too, that would be worth posted as an FR at the plugin’s repository’s issue tracker. If, instead, it’s in core, I agree that that would be really useful, but might be better tracked in a separate post.

---

<div class="post-metadata">

### Author: ![kelv](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kelv/32/524739_2.png) [@kelv](https://meta.discourse.org/u/kelv)
#### Post date: [10 באוקטובר,‏ 2025,‏ 8:27am UTC](https://meta.discourse.org/t/add-the-svg-file-extension-to-image-files/212333/20 "2025-10-10T08:27:14Z")

</div>

Thanks @pfaffman, I’ve brought this to the team’s attention and we agree that this now makes sense as a default. I’ve approved & merged the PR 🙂
