Make WordPress Core

Opened 17 years ago

Closed 13 years ago

#12350 closed enhancement (invalid)

Check folder permissions before uploading file

Reported by: not2bug Owned by:
Priority: normal Milestone:
Component: Administration Version:
Severity: normal Keywords:
Cc: Focuses:

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 @nacin
17 years ago

  • Milestone Unassigned
  • Resolution → worksforme
  • Status new → closed

It does.

#2 @kbcmdba
15 years ago

  • Cc kbcmdba added
  • Component General → Administration
  • Resolution worksforme
  • Status closed → 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).

#3 @SergeyBiryukov
15 years ago

  • Milestone → Awaiting Review

#4 @asdasDan
15 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');
 }

#5 @ocean90
13 years ago

  • Keywords upload media permission removed
  • Milestone Awaiting Review
  • Resolution → invalid
  • Status reopened → closed

The UI option is gone for new installations.

Note: See TracTickets for help on using tickets.