Opened 14 years ago
Closed 10 years ago
#12350 closed enhancement (invalid)
Check folder permissions before uploading file
Reported by: | not2bug | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Administration | Keywords: | |
Focuses: | Cc: |
Description
It would be nice if wordpress - or especially the media-upload module would check if its able or has the necessary file permissions to create the upload directory.
Change History (5)
#1
@
14 years ago
- Milestone Unassigned deleted
- Resolution set to worksforme
- Status changed from new to closed
#2
@
12 years ago
- Cc kbcmdba added
- Component changed from General to Administration
- Resolution worksforme deleted
- Status changed from closed to reopened
First, let me say - thanks for Wordpress - it's a fantastic tool for folks that don't need to care about HTML and just want to communicate.
I reopened this issue because I feel it describes what I'm seeing even though it was closed/worksforme by someone else.
When specifying the uploads folder as "/wp-content/uploads", WP doesn't gripe at me when there is no such folder on the file system (/wp-content/uploads, not ./wp-content/uploads). There is a folder in the WP tree with that name, but nothing with the absolute path of /wp-content/... If nothing else, I would expect WP to warn me (when configuring it as an admin) that the path I specified doesn't exist yet.
This report was made while using Wordpress 3.2.1 on CentOS 5.6. Wordpress was installed into the virtualhost root directory (not http://f.q.d.n/wordpress).
#4
@
12 years ago
Well in response to the /wp-content versus ./wp-content. I believe wordpress if it were to validate it would validate the path off of ABSPATH, so /wp-content/uploads would work.
This code was able to fix it on line 150 of wp-admin/options.php:
if ( $option == 'upload_path' && !file_exists(ABSPATH . $value) ) { add_settings_error('general', 'path-does-not-exist', __('Media Uploads Folder does not exist.'), 'error'); } elseif ( $option == 'upload_path' && !is_readable(ABSPATH . $value) ) { add_settings_error('general', 'path-not-readable', __('Media Uploads Folder is not readable.'), 'error'); }
It does.