# Cannot upload images with Safari

**URL:** https://meta.discourse.org/t/cannot-upload-images-with-safari/232563
**Category:** Bug
**Created:** [July 11, 2022, 10:05pm UTC](https://meta.discourse.org/t/cannot-upload-images-with-safari/232563 "2022-07-11T22:05:05Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![tut](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@tut](https://meta.discourse.org/u/tut)
#### Post date: [July 11, 2022, 10:05pm UTC](https://meta.discourse.org/t/cannot-upload-images-with-safari/232563/1 "2022-07-11T22:05:05Z")

</div>

Starting about one month ago, I have been unable to upload any graphics on Discourse. I get the typical progress information below the composing pane—20%, 40%, 100% uploaded. But once that finishes, the composing pane shows something along these lines (I entered this as preformatted text so everything would show):

`[Uploading: Screen Shot 2022-06-14 at 10.58.16 AM.png…]()`

and the finished message pane for the same thing will show:

Uploading: Screen Shot 2022-06-14 at 10.58.16 AM.png…

But at that point, no uploading activity is still underway. Obviously, the content that is supposed to be in parentheses isn’t uploading. Waiting for hours doesn’t change anything.

This occurs on a Mac running macOS v10.15.7 and Safari Version 15.5 (15613.2.7.1.9, 15613). When Discourse is accessed on the same machine via Firefox, everything functions normally.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [July 11, 2022, 10:19pm UTC](https://meta.discourse.org/t/cannot-upload-images-with-safari/232563/2 "2022-07-11T22:19:23Z")

</div>

Does something appears on the browser DevTools console when this happens?

---

<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: [July 11, 2022, 10:34pm UTC](https://meta.discourse.org/t/cannot-upload-images-with-safari/232563/3 "2022-07-11T22:34:37Z")

</div>

Are there any extensions enabled in Safari? Can you temporarily disable them?

---

<div class="post-metadata">

### Author: ![tut](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@tut](https://meta.discourse.org/u/tut)
#### Post date: [July 11, 2022, 10:40pm UTC](https://meta.discourse.org/t/cannot-upload-images-with-safari/232563/4 "2022-07-11T22:40:04Z")

</div>

> [@Falco](#):
>
> Does something appears on the browser DevTools console when this happens?

I’m a novice in that regard. Please advise where to look. In my version of Safari, I see only a `Develop` menu heading on the top bar.

---

<div class="post-metadata">

### Author: ![tut](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@tut](https://meta.discourse.org/u/tut)
#### Post date: [July 11, 2022, 10:43pm UTC](https://meta.discourse.org/t/cannot-upload-images-with-safari/232563/5 "2022-07-11T22:43:14Z")

</div>

> [@sam](#):
>
> Are there any extensions enabled in Safari?

No. This is just the standard installation.

---

<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: [July 12, 2022, 12:30am UTC](https://meta.discourse.org/t/cannot-upload-images-with-safari/232563/6 "2022-07-12T00:30:43Z")

</div>

> [@tut](#):
>
> I’m a novice in that regard. Please advise where to look. In my version of Safari, I see only a `Develop` menu heading on the top bar.

Yes this would be it! I think this random video on YouTube covers how to get to the console? [https://www.youtube.com/watch?v=kRRK3hZGw7I](https://www.youtube.com/watch?v=kRRK3hZGw7I)

---

<div class="post-metadata">

### Author: ![tut](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@tut](https://meta.discourse.org/u/tut)
#### Post date: [July 12, 2022, 3:50am UTC](https://meta.discourse.org/t/cannot-upload-images-with-safari/232563/7 "2022-07-12T03:50:48Z")

</div>

Sorry, but that video was so horribly produced I couldn’t follow it. Nevertheless, I think I found the “Console.” If I try to upload a JPG image named _Joss-Main_ to the message I am currently composing in Safari, this is the result:

Uploading: Joss-Main.jpg…

Logging in via Firefox and continuing on the same topic, I can upload a screen shot of the Safari Console window. Everything in the Console window appeared after dragging that one image to the composing pane (while in Safari). As you can see, the screen shot image uploads in Firefox just fine:

 ![Screen Shot 2022-07-11 at 9.42.35 PM](https://global.discourse-cdn.com/meta/original/4X/3/7/3/373178a3b6ffcf2f90e228d369ffa954601a21e4.png)

What else can I do to try to help sort this out?

---

<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: [July 12, 2022, 5:50am UTC](https://meta.discourse.org/t/cannot-upload-images-with-safari/232563/8 "2022-07-12T05:50:08Z")

</div>

Given you are using a super recent browser we can try to reproduce here. Assigining it internally to tech advocates so we can see if anyone else can reproduce the issue on Safari 15.5. At the moment I can not even test it on browserstack it is so recent (albeit 100% supported).

Can you upload the problem image here, or is it every single image?

---

<div class="post-metadata">

### Author: ![tut](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@tut](https://meta.discourse.org/u/tut)
#### Post date: [July 12, 2022, 12:37pm UTC](https://meta.discourse.org/t/cannot-upload-images-with-safari/232563/10 "2022-07-12T12:37:25Z")

</div>

It is every image I have tried. PNG, JPG, PDF…. File type and size do not matter.

---

<div class="post-metadata">

### Author: ![Noah](https://avatars.discourse-cdn.com/v4/letter/n/a87d85/32.png) [@Noah](https://meta.discourse.org/u/Noah)
#### Post date: [July 12, 2022, 5:17pm UTC](https://meta.discourse.org/t/cannot-upload-images-with-safari/232563/17 "2022-07-12T17:17:58Z")

</div>

Members in my community have the same issue, it seems that safari seems to be the main issue, I will try to fish out the issue for you.

---

<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: [July 13, 2022, 11:04am UTC](https://meta.discourse.org/t/cannot-upload-images-with-safari/232563/20 "2022-07-13T11:04:47Z")

</div>

Any luck @Noah?

We’ve tried for a simple repro but unfortunately have not been able to replicate it so far. There was another similar topic where the issue turned out to be something to do with a ClearURL browser extension, but I’m not sure that’s helpful here? [MacOS Firefox image upload error - #16 by jimkleiber](https://meta.discourse.org/t/macos-firefox-image-upload-error/212936/16)

---

<div class="post-metadata">

### Author: ![tut](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@tut](https://meta.discourse.org/u/tut)
#### Post date: [July 13, 2022, 12:41pm UTC](https://meta.discourse.org/t/cannot-upload-images-with-safari/232563/21 "2022-07-13T12:41:07Z")

</div>

There are key differences between my problem and the one reported by @jimkleiber:

- His problem was on Firefox. Firefox works for me.
- He had a browser extension that was ultimately identified as the problem. I have none.
- He saw an error message. In my case, Discourse behaves as though the image upload was successful.

---

<div class="post-metadata">

### Author: ![Noah](https://avatars.discourse-cdn.com/v4/letter/n/a87d85/32.png) [@Noah](https://meta.discourse.org/u/Noah)
#### Post date: [July 13, 2022, 9:01pm UTC](https://meta.discourse.org/t/cannot-upload-images-with-safari/232563/22 "2022-07-13T21:01:28Z")

</div>

Hi @JammyDodger sorry for the slow response, I’m about to conduct a test on my friends version of safari to see if it will pop anything out. @tut Out of interest what device are you using?

---

<div class="post-metadata">

### Author: ![tut](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@tut](https://meta.discourse.org/u/tut)
#### Post date: [July 13, 2022, 9:21pm UTC](https://meta.discourse.org/t/cannot-upload-images-with-safari/232563/23 "2022-07-13T21:21:38Z")

</div>

![Screen Shot 2022-07-13 at 3.15.04 PM](https://global.discourse-cdn.com/meta/original/4X/2/e/4/2e4c6d69a89d423979e68e1668db5713ae36e099.png)

A machine nearing the end of its useful life, hence the limitation to macOS v10.15.7.

---

<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: [July 14, 2022, 4:50am UTC](https://meta.discourse.org/t/cannot-upload-images-with-safari/232563/24 "2022-07-14T04:50:21Z")

</div>

Oh @david looks to me to be execCommand related per: [[BUG] Share \> Copy link broken in Safari · Issue #1716 · opensearch-project/OpenSearch-Dashboards · GitHub](https://github.com/opensearch-project/OpenSearch-Dashboards/issues/1716)

My guess is that somehow this version of Safari has bugs with it. This API being flagged “deprecated” is causing all sorts of pain cause browser tend to break it a bit?

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [July 14, 2022, 10:21am UTC](https://meta.discourse.org/t/cannot-upload-images-with-safari/232563/25 "2022-07-14T10:21:14Z")

</div>

> [@sam](#):
>
> looks to me to be execCommand

We don’t use `execCommand` when going from upload placeholders → URLs, so I don’t think that’s the cause here. (We can’t easily switch, because `execCommand("insertText")` requires the textarea to have focus, and uploads may finish when you don’t have the textarea focused).

Uploads [still use the `set("value", ...)` method which we’ve been using for years](https://github.com/discourse/discourse/blob/605aafec302c77636e35cca79edebfd073840c0a/app/assets/javascripts/discourse/app/mixins/textarea-text-manipulation.js#L145-L155)

> [@sam](#):
>
> This API being flagged “deprecated” is causing all sorts of pain cause browser tend to break it a bit?

It’s technically deprecated from the web standards, but there is not yet any alternative for the `insertText` command. [From MDN](https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand):

> The [Clipboard API](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API) can be used instead of `execCommand` in many cases, but `execCommand` is still sometimes useful. In particular, **the Clipboard API doesn’t replace the `insertText` command** , which you can use to programmatically replace text at the cursor while preserving the undo buffer (edit history) in plain `textarea` and `input` elements.

Given the widespread use, it seems incredibly unlikely that browsers are going to drop support for this without first providing an alternative and a deprecation window.

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [July 18, 2022, 11:00am UTC](https://meta.discourse.org/t/cannot-upload-images-with-safari/232563/28 "2022-07-18T11:00:15Z")

</div>

@tut I’ve just added some extra debugging information here on Meta so that we can try and work out what’s happening. Please can you try:

1. Open Meta in Safari
2. Open the developer console
3. Try to upload a file
4. Click in the developer console
5. Cmd + a to select all the logs
6. Right click → save selected
7. Save the text file somewhere, and then upload it here (using Firefox, I suppose)

---

<div class="post-metadata">

### Author: ![tut](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@tut](https://meta.discourse.org/u/tut)
#### Post date: [July 18, 2022, 5:54pm UTC](https://meta.discourse.org/t/cannot-upload-images-with-safari/232563/31 "2022-07-18T17:54:57Z")

</div>

@david, here is my attempt to upload a JPEG image named `Joss-Main.jpg` while in Safari:

Uploading: Joss-Main.jpg…

As expected, the upload did not complete.

* * *

Now I have switched to Firefox and picked up composing the same message.

[Console.txt](https://meta.discourse.org/uploads/short-url/wRDKJpETstpY3oqIjPM4WiSrZAr.txt) (4.1 KB)

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [July 18, 2022, 6:19pm UTC](https://meta.discourse.org/t/cannot-upload-images-with-safari/232563/32 "2022-07-18T18:19:16Z")

</div>

Ok wow, this is a weird one! Safari is replacing the `...` (three periods) with an ellipses character `…`. That then breaks our later attempt to replace the placeholder with the true url.

@tut can you open your system preferences → Keyboard → Text, and see whether you have a replacement configured there. If I add a `...` → `…` replacement, then I can reproduce the same issue in Safari on my machine:

 ![Screenshot 2022-07-18 at 19.16.16](https://global.discourse-cdn.com/meta/original/4X/9/c/1/9c1d4a20728b2d799161c174a79f73f9df07fcd4.png)

(yours may look slightly different due to the older macOS version)

> [@sam](#):
>
> execCommand relate

So yeah, this seems quite likely - sorry for discarding that idea earlier @sam 😅. Looks like Safari is applying OS-level text replacements to text that we add via `execCommand("insertText",`. I wonder if that’s a new thing in Safari 15.5, or whether it’s always been the case and we just haven’t noticed 🤔

---

<div class="post-metadata">

### Author: ![tut](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@tut](https://meta.discourse.org/u/tut)
#### Post date: [July 18, 2022, 9:13pm UTC](https://meta.discourse.org/t/cannot-upload-images-with-safari/232563/33 "2022-07-18T21:13:21Z")

</div>

@david, I have no such substitution set up under Keyboard preferences. Now that I know what to look for, however, I can confirm that the substitution occurs. I can actually see it happen as I type. And I can verify it by using the back arrow. When I get to the ellipses character, the cursor jumps back over all three periods that were entered as separate characters.

The same thing happens in Notes, Preview, Messages, and Mail, but not Calendar, Maps, Photos, or (obviously) Firefox. So it seems to be an app-specific thing, not a system-level one.

[Next page](https://meta.discourse.org/t/cannot-upload-images-with-safari/232563.md?page=2)
