# Opzioni di caricamento più flessibili per l'amministratore?

**URL:** https://meta.discourse.org/t/more-flexible-upload-options-for-admin/118985
**Category:** Feature
**Created:** [29 Maggio 2019, 12:23pm UTC](https://meta.discourse.org/t/more-flexible-upload-options-for-admin/118985 "2019-05-29T12:23:42Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![hawm](https://avatars.discourse-cdn.com/v4/letter/h/f07891/32.png) [@hawm](https://meta.discourse.org/u/hawm)
#### Post date: [29 Maggio 2019, 12:23pm UTC](https://meta.discourse.org/t/more-flexible-upload-options-for-admin/118985/1 "2019-05-29T12:23:43Z")

</div>

Support disable user upload at post or topic but available for user avatar and profile backgrounds etc.  
Set the max size to 0 and hide the upload button or options on post by CSS not really a good way, it break all upload even admin like category background image.

> [@Remove image uploading in posts](https://meta.discourse.org/t/remove-image-uploading-in-posts/23743):
>
> Is there a way to remove the upload option for images? We didn’t want to “host” images on our forums. We’d rather the end users just put the image link in. If this isn’t an option, is there a way to hide the image upload button? (CSS?)

---

<div class="post-metadata">

### Author: ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)
#### Post date: [29 Maggio 2019, 12:34pm UTC](https://meta.discourse.org/t/more-flexible-upload-options-for-admin/118985/2 "2019-05-29T12:34:22Z")

</div>

See if this will meet your needs:

> [@Restrict uploads](https://meta.discourse.org/t/restrict-uploads/112688):
>
> This is a very small theme component that will remove the upload button from the composer toolbar and disable drag-and-drop uploading for users that are under a specified trust level. Illustration Settings hammer_and_wrenchRepository [github.com/tshenry/discourse-restrict-uploads](https://github.com/tshenry/discourse-restrict-uploads)open_bookNew to Discourse Themes? [Beginner’s guide to using Discourse Themes](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966) Install this theme component

---

<div class="post-metadata">

### Author: ![hawm](https://avatars.discourse-cdn.com/v4/letter/h/f07891/32.png) [@hawm](https://meta.discourse.org/u/hawm)
#### Post date: [29 Maggio 2019, 2:05pm UTC](https://meta.discourse.org/t/more-flexible-upload-options-for-admin/118985/3 "2019-05-29T14:05:12Z")

</div>

@tshenry  
A good component. But it seem too basic? The code looks only restrict the browser UI.

---

<div class="post-metadata">

### Author: ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)
#### Post date: [30 Maggio 2019, 4:28am UTC](https://meta.discourse.org/t/more-flexible-upload-options-for-admin/118985/4 "2019-05-30T04:28:02Z")

</div>

I’m not sure what you mean by too basic. It prevents the upload button from rendering on the composer toolbar and disables the drag-and-drop upload functionality of the composer. This will only apply to users under a trust-level you specify in the theme setting. It’s not just hiding a button with CSS if that’s what you are concerned about.

Theme components are super easy to add and remove, so there’s no harm in testing it out and seeing if it meets you needs.

---

<div class="post-metadata">

### Author: ![hawm](https://avatars.discourse-cdn.com/v4/letter/h/f07891/32.png) [@hawm](https://meta.discourse.org/u/hawm)
#### Post date: [30 Maggio 2019, 12:33pm UTC](https://meta.discourse.org/t/more-flexible-upload-options-for-admin/118985/5 "2019-05-30T12:33:31Z")

</div>

Yes, i already install the component and actually it is working not bad.  
What i mean about “too basic” is the component still restrict the web editor only.

The code below i guess it will only disable the upload or reply placeholder on the web editor(if i was wrong that i have no question with the component, ignore below).  
[https://github.com/tshenry/discourse-restrict-uploads/blob/master/common/head\_tag.html](https://github.com/tshenry/discourse-restrict-uploads/blob/master/common/head_tag.html)

I know the upload using [Upload API](https://docs.discourse.org/#tag/Upload), so somebody which familiar with network programming may construct some HTTP requests(i dont know if some security like CORS can protect it) to bypass the component then upload file(even though the uploaded is harmless, but any upload by user are not our expected).

So, restrict the Upload API `type` field in the back-end may improve it? I am newbie to Discourse and programming.  
Thanks.

---

<div class="post-metadata">

### Author: ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)
#### Post date: [30 Maggio 2019, 1:05pm UTC](https://meta.discourse.org/t/more-flexible-upload-options-for-admin/118985/6 "2019-05-30T13:05:57Z")

</div>

> [@hawm](#):
>
> I know the upload using [Upload API](https://docs.discourse.org/#tag/Upload), so somebody which familiar with network programming may construct some HTTP requests(i dont know if some security like CORS can protect it) to bypass the component then upload file(even though the uploaded is harmless, but any upload by user are not our expected).

Hopefully I will be corrected if I am wrong, but I believe they would need to have a valid API key do that. An API key would need to be explicitly generated for a user by an admin.

You are correct, though. This is not a server-side solution. If you need an extremely secure solution, you would need to build a plugin or hope that the feature is added to core.

---

<div class="post-metadata">

### Author: ![hawm](https://avatars.discourse-cdn.com/v4/letter/h/f07891/32.png) [@hawm](https://meta.discourse.org/u/hawm)
#### Post date: [30 Maggio 2019, 2:01pm UTC](https://meta.discourse.org/t/more-flexible-upload-options-for-admin/118985/7 "2019-05-30T14:01:57Z")

</div>

I am clear now, thanks！
