# 在图片上传中隐藏“来自网络”选项

**URL:** https://meta.discourse.org/t/hide-from-the-web-in-image-upload/90907
**Category:** Support
**Created:** [2018年六月27日 22:56 UTC](https://meta.discourse.org/t/hide-from-the-web-in-image-upload/90907 "2018-06-27T22:56:21Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![davidkingham](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/davidkingham/32/119528_2.png) [@davidkingham](https://meta.discourse.org/u/davidkingham)
#### Post date: [2018年六月27日 22:56 UTC](https://meta.discourse.org/t/hide-from-the-web-in-image-upload/90907/1 "2018-06-27T22:56:21Z")

</div>

I would prefer users only upload images rather than having the option of using images on the web due to various display reasons. I tried to hide via css but the selectors seem to be the same for both options, the radio buttons would need to be hidden as well.

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [2018年六月27日 23:20 UTC](https://meta.discourse.org/t/hide-from-the-web-in-image-upload/90907/2 "2018-06-27T23:20:50Z")

</div>

Just make sure that `download remote images to local` is enabled, and linked images will be downloaded to the server and served locally.

---

<div class="post-metadata">

### Author: ![davidkingham](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/davidkingham/32/119528_2.png) [@davidkingham](https://meta.discourse.org/u/davidkingham)
#### Post date: [2018年六月27日 23:33 UTC](https://meta.discourse.org/t/hide-from-the-web-in-image-upload/90907/3 "2018-06-27T23:33:19Z")

</div>

Thanks Kane, I do have that turned on which helps with some issues, but ultimately I want to avoid external links for images, I know they will still be able to paste a link but I would like to have the option less obvious.

---

<div class="post-metadata">

### Author: ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)
#### Post date: [2018年六月28日 05:33 UTC](https://meta.discourse.org/t/hide-from-the-web-in-image-upload/90907/4 "2018-06-28T05:33:22Z")

</div>

You can use [:nth-of-type()](https://developer.mozilla.org/en-US/docs/Web/CSS/:nth-of-type) in your CSS if there’s no unique selector for the element you want to target.

 ![Capture](https://global.discourse-cdn.com/meta/original/3X/0/a/0a30cf4b4c2a01edf4beeb082565894a5e1d2633.PNG)

```plaintext
.upload-selector {
  label,
  input[type="radio"],
  .radios:nth-of-type(2) {
    display: none;
  }
}

```

---

<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: [2018年六月28日 13:08 UTC](https://meta.discourse.org/t/hide-from-the-web-in-image-upload/90907/5 "2018-06-28T13:08:02Z")

</div>

What display reasons are affected by where an image is? If you disable them being able to have discourse download the image from the web, they can just download the image locally and then upload it, right?

Or is it that they might have access to an image because they are logged in to a site and discourse can’t get it because it’s not public?

I don’t understand why problem you’re solving.

---

<div class="post-metadata">

### Author: ![davidkingham](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/davidkingham/32/119528_2.png) [@davidkingham](https://meta.discourse.org/u/davidkingham)
#### Post date: [2018年六月28日 16:35 UTC](https://meta.discourse.org/t/hide-from-the-web-in-image-upload/90907/6 "2018-06-28T16:35:38Z")

</div>

The display issues were resolved by either the `download remote images to local` or there was a bug fix in topic list preview plugin, not sure which but the images were not displaying in the previews before but are now.

So the main issue I was trying to resolve was users posting a link to their website where the image is located, but not a direct link to the jpg which obviously just shows a tiny preview and users have to leave the site to go view the image and may possibly not come back or not view the image because they have to leave the site. Since my forum is centered around photography and image critiques this was important to me.

---

<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: [2018年六月28日 20:25 UTC](https://meta.discourse.org/t/hide-from-the-web-in-image-upload/90907/7 "2018-06-28T20:25:01Z")

</div>

> [@davidkingham](#):
>
> the main issue I was trying to resolve was users posting a link to their website where the image is located, but not a direct link to the jpg

If you figure out how to resolve that, you’ll be rich. 😉

---

<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: [2018年七月28日 20:25 UTC](https://meta.discourse.org/t/hide-from-the-web-in-image-upload/90907/8 "2018-07-28T20:25:33Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
