Opened 5 years ago
Last modified 13 months ago
#50188 new enhancement
Disable Media uploader if PHP file_uploads is disabled
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | minor | Version: | |
Component: | Upload | Keywords: | 2nd-opinion needs-patch |
Focuses: | Cc: |
Description
Based on ticket #50038, if the PHP configuration is file_uploads = Off
we should disable the Media upload.
Actually, when you upload a file and the file_uploads is disabled, WordPress uploads the file with a progress bar and, at the end, it gives an error because is disabled.
This should affect the Media upload, probably it should tell something like "You can't upload a file, please check the Site Health for more information" (or something like that) but also, in any file upload (like the Image / Video / Audio on Gutenberg) should allow to pick from the media but not show the upload button, also the plugin / theme upload.
Attachments (2)
Change History (13)
#3
@
5 years ago
- Keywords needs-patch added
Just noting the Health Check entry is being worked on in #50038 :)
@
5 years ago
A patch that adds a new "File upload settings" section to Site Health > Debug page. It takes values from PHP INI settings, and also shows the effective file size (min value of the post-max and max-file-size settings).
#4
@
5 years ago
Oops, I'm sorry I removed your tag @SergeyBiryukov, I submitted an old comment form I suppose. Thanks for the additional links.
#5
@
5 years ago
So, I've been thinking about the ticket and, we can do this for only the "file_upload" directive, but it could also be a good functionality, so for example, if we create a "define" option at the WP-Config like WP_DISABLE_UPLOADS (true, false) we could block the upload thing in all the system. I don't know, but could be useful if some installations cannot have uploads or there are no need for that.
Hi @JavierCasares - welcome back to WP Trac.
I think it's a great idea to have a Health Check section for file uploads. Disabling the file upload button and the error message contents will need some discussing back and forth with core maintainers to deciding the UX patterns, but I will be working on the health-check entry.