Make WordPress Core

Opened 6 years ago

Closed 15 hours ago

#11642 closed enhancement (maybelater)

Allow to define upload path and url in wp-config.php

Reported by: sirzooro Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.9
Component: Upload Keywords: needs-patch
Focuses: Cc:


When someone wants to move default directories elsewhere, he/she must do work in two places: add defines to wp-config.php and change upload path on settings page. I think it will be good to introduce two new defines: UPLOAD_PATH and UPLOAD_URL_PATH. When they will be defined, WordPress should use them and do not allow to change these on settings page - similarly to home and site url options.

Change History (8)

comment:1 @sivel6 years ago

You can define the upload path in wp-config.php, not the url however. The url is decided based on the relative path you provide for UPLOADS. The constant you would use is UPLOADS, and it is relative to ABSPATH.

From the code:

    if ( defined('UPLOADS') ) {
        $dir = ABSPATH . UPLOADS;
        $url = trailingslashit( $siteurl ) . UPLOADS;

comment:2 @Denis-de-Bernardy6 years ago

  • Milestone changed from 3.0 to Future Release

UPLOADS is not always the best idea. I'd like the url to be media.example.com/www (on amazon s3) for www.example.com (on my server).

Punting pending patch, though.

comment:3 @mikeschinkel5 years ago

  • Cc mikeschinkel@… added

comment:4 @toscho3 years ago

  • Cc info@… added

comment:5 @nacin21 months ago

  • Component changed from General to Upload

comment:6 follow-up: @jbkkd21 months ago

  • Resolution set to invalid
  • Status changed from new to closed

This option does not exist anymore on the Settings page.

comment:7 in reply to: ↑ 6 @nacin20 months ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

Replying to jbkkd:

This option does not exist anymore on the Settings page.

Correct, but there is still a need to modify these values. I'm still for a patch here. UPLOADS is pretty lame.

comment:8 @chriscct715 hours ago

  • Milestone Future Release deleted
  • Resolution set to maybelater
  • Status changed from reopened to closed

Closing as maybelater. Complete lack of interest on the feature on the ticket over the last 2 years. Feel free to reopen when more interest re-emerges (particularly if there's a patch)

Note: See TracTickets for help on using tickets.