# 下载远程图片的限制有哪些

**URL:** <https://meta.discourse.org/t/what-are-the-limitations-of-download-remote-images/64356>\
**Category:** Support\
**Created:** [2017年六月12日 14:50 UTC](https://meta.discourse.org/t/what-are-the-limitations-of-download-remote-images/64356 "2017-06-12T14:50:16Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![RBoy](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@RBoy](https://meta.discourse.org/u/RBoy)\
**Post date:** [2017年六月12日 14:50 UTC](https://meta.discourse.org/t/what-are-the-limitations-of-download-remote-images/64356/1 "2017-06-12T14:50:16Z")

</div>

I’ve enabled the `Download remote images to local` option in the admin settings (I’m assuming this isn’t a per user option).

Then I created a test post:

```plaintext
http://3.bp.blogspot.com/-J9fTEDADHTQ/TejcTyXqfFI/AAAAAAAAADQ/SlOrlRq2M9c/s1600/TESTING-white.png

[Some Text](http://3.bp.blogspot.com/-J9fTEDADHTQ/TejcTyXqfFI/AAAAAAAAADQ/SlOrlRq2M9c/s1600/TESTING-white.png)

[img]http://3.bp.blogspot.com/-J9fTEDADHTQ/TejcTyXqfFI/AAAAAAAAADQ/SlOrlRq2M9c/s1600/TESTING-white.png[/img]

```

The results showed that all the 3 images still pointed to the remote server (atleast the code didnt’ change to show it was pointing locally or to amazon). Note that I’ve enabled the option to upload content to Amazon S3 (if that matters).

I’ve been through some posts which talk about ways to prevent it from downloading but in this case the 3 most common ways of posting an image doesn’t seem to download it.

So under what conditions does downloading remote images work and what’s the best way to configure it?

---

<div class="post-metadata">

**Author:** ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)\
**Post date:** [2017年六月12日 15:04 UTC](https://meta.discourse.org/t/what-are-the-limitations-of-download-remote-images/64356/2 "2017-06-12T15:04:53Z")

</div>

If `Download remote images to local` SiteSetting enabled whenever a post created then all the external images will be downloaded locally (In all 3 above cases). But the downloading process will start only after `editing_grace_period` SiteSetting (default 10 minutes) from the creation of post. Also it will not be triggered for existing old posts when you enable the `Download remote images to local` SiteSetting. For that you have to recook all old posts.

Also downloading remote images will not work in below conditions

1. SiteSetting `download_remote_images_to_local` is disabled.
2. Enough disk space not available to download. (In this case you will receive notification about the problem). Also look at the `download remote images threshold` SiteSetting.
3. If the post date is before `download_remote_images_max_days_old` SiteSetting.
4. If the image is from one of the domains of `disabled image download domains` SiteSetting.

---

<div class="post-metadata">

**Author:** ![RBoy](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@RBoy](https://meta.discourse.org/u/RBoy)\
**Post date:** [2017年六月12日 15:22 UTC](https://meta.discourse.org/t/what-are-the-limitations-of-download-remote-images/64356/3 "2017-06-12T15:22:33Z")

</div>

Great thanks that worked, also want to clarify for the benefit of others, in my examples above, the 1st and 3rd options WILL lead to an automatic download after the conditions in your post are satisfied. However the 2nd example, WILL NOT download the remote image.

So, these WILL automatically download (after your conditions are satisfied, the code will be replaced to reflect the local url or amazon S3 url)

- Directly posting the link
- Images using the `[img]` and `[/img]` tags

```plaintext
http://3.bp.blogspot.com/-J9fTEDADHTQ/TejcTyXqfFI/AAAAAAAAADQ/SlOrlRq2M9c/s1600/TESTING-white.png

[img]http://3.bp.blogspot.com/-J9fTEDADHTQ/TejcTyXqfFI/AAAAAAAAADQ/SlOrlRq2M9c/s1600/TESTING-white.png[/img]

```

  

And these WILL _NOT_ automatically download (code will not be changed)

- When images are hyperlinked to text

```plaintext
[Some Text](http://3.bp.blogspot.com/-J9fTEDADHTQ/TejcTyXqfFI/AAAAAAAAADQ/SlOrlRq2M9c/s1600/TESTING-white.png)

```

---

<div class="post-metadata">

**Author:** ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)\
**Post date:** [2017年六月12日 15:40 UTC](https://meta.discourse.org/t/what-are-the-limitations-of-download-remote-images/64356/4 "2017-06-12T15:40:11Z")

</div>

By “remote images” we mean “inlined images not stored in Discourse”.

When you do “`[Some text](://link-to.com/image.png)`”, the image is **not** inlined, it’s linked.

---

<div class="post-metadata">

**Author:** ![8BIT](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/8bit/32/76872_2.png) [@8BIT](https://meta.discourse.org/u/8BIT)\
**Post date:** [2018年一月22日 22:43 UTC](https://meta.discourse.org/t/what-are-the-limitations-of-download-remote-images/64356/5 "2018-01-22T22:43:17Z")

</div>

Looking at doing this and turning it on… does `max image size kb` impact what it will and will not pull?

For instance, we use a lot of gifs from [giphy.com](http://giphy.com) and many of these are larger than the default size of `3072kB`.

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)\
**Post date:** [2020年四月13日 06:23 UTC](https://meta.discourse.org/t/what-are-the-limitations-of-download-remote-images/64356/6 "2020-04-13T06:23:08Z")

</div>



---

<div class="post-metadata">

**Author:** ![hnaseri](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hnaseri/32/120660_2.png) [@hnaseri](https://meta.discourse.org/u/hnaseri)\
**Post date:** [2022年八月22日 20:08 UTC](https://meta.discourse.org/t/what-are-the-limitations-of-download-remote-images/64356/7 "2022-08-22T20:08:43Z")

</div>

是否计划在图片之外添加其他媒体？

---

<div class="post-metadata">

**Author:** ![Isambard](https://avatars.discourse-cdn.com/v4/letter/i/858c86/32.png) [@Isambard](https://meta.discourse.org/u/Isambard)\
**Post date:** [2024年六月1日 23:32 UTC](https://meta.discourse.org/t/what-are-the-limitations-of-download-remote-images/64356/9 "2024-06-01T23:32:19Z")

</div>

> [@vinothkannans](#):
>
> `download_remote_images_max_days_old`

这个设置还存在吗？我在设置中找不到它。

---

<div class="post-metadata">

**Author:** ![Firepup650](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/firepup650/32/465200_2.png) [@Firepup650](https://meta.discourse.org/u/Firepup650)\
**Post date:** [2024年六月2日 00:11 UTC](https://meta.discourse.org/t/what-are-the-limitations-of-download-remote-images/64356/10 "2024-06-02T00:11:50Z")

</div>

似乎不会，在“下载远程”中没有显示

 ![image](https://global.discourse-cdn.com/meta/original/4X/0/1/6/01605d1b316bd67dcc0721254821998073d09e9a.png)

---

<div class="post-metadata">

**Author:** ![Isambard](https://avatars.discourse-cdn.com/v4/letter/i/858c86/32.png) [@Isambard](https://meta.discourse.org/u/Isambard)\
**Post date:** [2024年六月2日 07:05 UTC](https://meta.discourse.org/t/what-are-the-limitations-of-download-remote-images/64356/11 "2024-06-02T07:05:27Z")

</div>

我想知道此案例是否仍然只在创建时获取新消息，或者是否已更改并获取旧消息。

我想确保只下载新消息中的图片，因为我导入了很多旧消息，并且不想让服务器臃肿。
