# Upload an image without embedding it

**URL:** https://meta.discourse.org/t/upload-an-image-without-embedding-it/103733
**Category:** Support
**Created:** [December 7, 2018, 9:51pm UTC](https://meta.discourse.org/t/upload-an-image-without-embedding-it/103733 "2018-12-07T21:51:39Z")
**Posts on this page:** 19
**Page:** 1

<div class="post-metadata">

### Author: ![codechef](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codechef/32/90261_2.png) [@codechef](https://meta.discourse.org/u/codechef)
#### Post date: [December 7, 2018, 9:51pm UTC](https://meta.discourse.org/t/upload-an-image-without-embedding-it/103733/1 "2018-12-07T21:51:39Z")

</div>

Hopefully a simple question that I’m over-complicating, but I cannot figure this out. Is there any way to upload an image to a post without embedding it? Basically, I’d want to attach an image file like you would a PDF so that it’s downloadable by clicking it.

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [December 7, 2018, 10:09pm UTC](https://meta.discourse.org/t/upload-an-image-without-embedding-it/103733/2 "2018-12-07T22:09:23Z")

</div>

Sure - just change the markdown generated by the upload as per below:

* * *

Original is:

```md
![worksonmymachine|200x193,50%](upload://wD4QT0WxzqkxFMKMI8QRQoRCcWC.png)

```

resuliting in:

 ![worksonmymachine](https://global.discourse-cdn.com/meta/original/3X/e/4/e4b06ce98ded89163747305342cf0074d4260202.png)

* * *

Option 1 is:

```md
[worksonmymachine.png](upload://wD4QT0WxzqkxFMKMI8QRQoRCcWC.png)

```

[worksonmymachine.png](https://meta.discourse.org/uploads/short-url/wD4QT0WxzqkxFMKMI8QRQoRCcWC.png)

EDIT: oops - that one doesn’t actually work… need to specify the full path:

```md
[worksonmymachine.png](//cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/meta/original/3X/e/4/e4b06ce98ded89163747305342cf0074d4260202.png)

```

[worksonmymachine.png](https://global.discourse-cdn.com/meta/original/3X/e/4/e4b06ce98ded89163747305342cf0074d4260202.png)

* * *

Option 2 makes it look like a usual “attachment” upload:

```html
<a class="attachment" href="//cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/meta/original/3X/e/4/e4b06ce98ded89163747305342cf0074d4260202.png">womm.png</a> (31443 Bytes)

```

resulting in:  
[womm.png](https://global.discourse-cdn.com/meta/original/3X/e/4/e4b06ce98ded89163747305342cf0074d4260202.png) (31443 Bytes)

A left-click will still view the image. I don’t believe you can force a user to download the file; that’s controlled by the `Content-Disposition` header sent by the server.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [December 7, 2018, 10:30pm UTC](https://meta.discourse.org/t/upload-an-image-without-embedding-it/103733/4 "2018-12-07T22:30:22Z")

</div>

Note that this is a very hacky “solution”, it might sort of work as a quick fix but I’m not sure I would recommend it as a general practice.

---

<div class="post-metadata">

### Author: ![codechef](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codechef/32/90261_2.png) [@codechef](https://meta.discourse.org/u/codechef)
#### Post date: [December 7, 2018, 10:31pm UTC](https://meta.discourse.org/t/upload-an-image-without-embedding-it/103733/5 "2018-12-07T22:31:08Z")

</div>

Option 1 was my first attempt, then I fell back to your EDIT 😆

Were you able to identify the full url _before_ posting? I’m trying to come up with something that doesn’t require the user to “inspect” the image url in the preview…

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [December 7, 2018, 10:32pm UTC](https://meta.discourse.org/t/upload-an-image-without-embedding-it/103733/6 "2018-12-07T22:32:00Z")

</div>

> [@codechef](#):
>
> Is there any way to upload an image to a post without embedding it? Basically, I’d want to attach an image file like you would a PDF so that it’s downloadable by clicking it.

Why don’t you construct the links in angle brackets?

 ![cubicle_sweet_cubicle](https://global.discourse-cdn.com/meta/original/3X/e/3/e3a33e7186437ab72d2fdcfb5f45c812ae25a571.gif)

[https://global.discourse-cdn.com/meta/original/3X/e/3/e3a33e7186437ab72d2fdcfb5f45c812ae25a571.gif](https://global.discourse-cdn.com/meta/original/3X/e/3/e3a33e7186437ab72d2fdcfb5f45c812ae25a571.gif)

`<https://global.discourse-cdn.com/meta/original/3X/e/3/e3a33e7186437ab72d2fdcfb5f45c812ae25a571.gif>`

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [December 7, 2018, 10:33pm UTC](https://meta.discourse.org/t/upload-an-image-without-embedding-it/103733/7 "2018-12-07T22:33:27Z")

</div>

> [@codechef](#):
>
> I’m trying to come up with something that doesn’t require the user to “inspect” the image url in the preview

Right-click, Copy image address?

---

<div class="post-metadata">

### Author: ![codechef](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codechef/32/90261_2.png) [@codechef](https://meta.discourse.org/u/codechef)
#### Post date: [December 7, 2018, 10:36pm UTC](https://meta.discourse.org/t/upload-an-image-without-embedding-it/103733/9 "2018-12-07T22:36:46Z")

</div>

> [@supermathie](#):
>
> that’s controlled by the `Content-Disposition` header sent by the server.

Somehow the onebox viewer provides a download link…

 ![image](https://global.discourse-cdn.com/meta/original/3X/1/4/14c00d6193eacc43baeaa107247a8b6d61026558.png)

EDIT: Well, that didn’t demo like I thought it would…

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [December 7, 2018, 10:38pm UTC](https://meta.discourse.org/t/upload-an-image-without-embedding-it/103733/10 "2018-12-07T22:38:40Z")

</div>

Did you add the angle brackets as I said?

`<https://global.discourse-cdn.com/meta/original/3X/e/3/e3a33e7186437ab72d2fdcfb5f45c812ae25a571.gif>`

---

<div class="post-metadata">

### Author: ![codechef](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codechef/32/90261_2.png) [@codechef](https://meta.discourse.org/u/codechef)
#### Post date: [December 7, 2018, 10:43pm UTC](https://meta.discourse.org/t/upload-an-image-without-embedding-it/103733/11 "2018-12-07T22:43:57Z")

</div>

> [@codinghorror](#):
>
> Did you add the angle brackets as I said?

Clicking that a link with angle brackets displays the image in the browser rather than downloading it ☹

I’m seeing in the image viewer a download link that is a different image URL. Trying to track the source of that link down now…

 ![image](https://global.discourse-cdn.com/meta/original/3X/3/b/3bb8d2634da50e66c4e2a426fee51a8ce278d327.png)

EDIT: …and determine if that link is available at post time.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [December 7, 2018, 10:47pm UTC](https://meta.discourse.org/t/upload-an-image-without-embedding-it/103733/12 "2018-12-07T22:47:00Z")

</div>

> [@codechef](#):
>
> Clicking that a link with angle brackets displays the image in the browser rather than downloading it

Right click it and select “Save Link As…” – this works on any link in the browser.

 ![image](https://global.discourse-cdn.com/meta/original/3X/2/f/2fdda327be30eb4452fd6f3362cdda7dc6fc2f69.png)

---

<div class="post-metadata">

### Author: ![codechef](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codechef/32/90261_2.png) [@codechef](https://meta.discourse.org/u/codechef)
#### Post date: [December 7, 2018, 10:50pm UTC](https://meta.discourse.org/t/upload-an-image-without-embedding-it/103733/13 "2018-12-07T22:50:47Z")

</div>

> [@codinghorror](#):
>
> Right click it and select “Save Link As…” – this works on any link in the browser.

I know, I know 🙂

The use case is posting items for download as a meeting summary. Those items will sometimes be PDFs, Word docs, slide decks, and images. It would be weird if some some links downloaded and others displayed, right?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [December 7, 2018, 10:51pm UTC](https://meta.discourse.org/t/upload-an-image-without-embedding-it/103733/14 "2018-12-07T22:51:27Z")

</div>

If it’s really so necessary, create a new PDF with the image in it? This is a trivial operation in Word, new doc, paste image, save as PDF.

---

<div class="post-metadata">

### Author: ![codechef](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codechef/32/90261_2.png) [@codechef](https://meta.discourse.org/u/codechef)
#### Post date: [December 7, 2018, 10:57pm UTC](https://meta.discourse.org/t/upload-an-image-without-embedding-it/103733/15 "2018-12-07T22:57:40Z")

</div>

Okay, I have a handful of workarounds to consider. I really appreciate you guys’ help working through this. Thanks for the quick responses. You guys rock @codinghorror and @supermathie!

---

<div class="post-metadata">

### Author: ![codechef](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codechef/32/90261_2.png) [@codechef](https://meta.discourse.org/u/codechef)
#### Post date: [December 7, 2018, 11:09pm UTC](https://meta.discourse.org/t/upload-an-image-without-embedding-it/103733/16 "2018-12-07T23:09:36Z")

</div>

@codinghorror how dangerous is this? I found a solution that works locally, but may not work for CDN scenarios…

1. Copy the image url from the preview window
2. Get just the UUID portion
3. Hack the link to be /uploads/default/{UUID}

For example:

`[Cool image to download](/uploads/default/a099b7b187922f26fbebbbb47807fc83da11fc55)`

One a scale of 1 to close your computer and go home for the weekend, how dangerous is this?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [December 7, 2018, 11:11pm UTC](https://meta.discourse.org/t/upload-an-image-without-embedding-it/103733/17 "2018-12-07T23:11:31Z")

</div>

@sam says it’ll get deleted by the automatic unreferenced image tombstoning task, so.. as predicted.. bad idea.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [December 7, 2018, 11:26pm UTC](https://meta.discourse.org/t/upload-an-image-without-embedding-it/103733/18 "2018-12-07T23:26:24Z")

</div>

As an admin the hack @supermathie suggested will work if you also upload the image totally normally on a **different** staff only topic. Or in a PM to yourself. That way it will not be deleted.

---

<div class="post-metadata">

### Author: ![codechef](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codechef/32/90261_2.png) [@codechef](https://meta.discourse.org/u/codechef)
#### Post date: [December 7, 2018, 11:28pm UTC](https://meta.discourse.org/t/upload-an-image-without-embedding-it/103733/19 "2018-12-07T23:28:06Z")

</div>

Is the task looking for the upload:// link in posts?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [December 7, 2018, 11:39pm UTC](https://meta.discourse.org/t/upload-an-image-without-embedding-it/103733/20 "2018-12-07T23:39:09Z")

</div>

no it looks for actual images which are linked uploads to the post. I do am no 10000% certain but I don’t think we track an association for `A HREF` to upload, but maybe I am wrong need to review the code.

---

<div class="post-metadata">

### Author: ![Devansh\_Khetan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/devansh_khetan/32/183628_2.png) [@Devansh\_Khetan](https://meta.discourse.org/u/Devansh_Khetan)
#### Post date: [June 17, 2020, 4:16pm UTC](https://meta.discourse.org/t/upload-an-image-without-embedding-it/103733/23 "2020-06-17T16:16:31Z")

</div>

I have got an easy solution to this.  
Just decrease your max image width and max image height with some small no. like 250px X 250px  
Then all the images bigger then this will be send as attachment and you expand it and a card will open which have download option.  
Images for reference-

1. 

2.
