The MU forums have moved to WordPress.org

How do you change upload path /files? in Mu (6 posts)

  1. realchaos1
    Member
    Posted 14 years ago #

    I modified wp-settings.php, includes/mu.php, wp-includes/wpmu-fuctions.php, .htaccess from /files to /resources renamed the blogs.dir/{blogid}/files directories to /resources.

    I also modified wp-admin -> blogs -> edit -> Upload Path and Fileupload Url

    Now WordPress Mu uploads to the new directory fine, but with one draw back.

    When a user uploads a photo and inserts media into post, it still spits out:
    domain.com/files/img.jpg

    How do I change the insert media output to:
    domain.com/resources/img.jpg????

    I've been skimming the source in files like media-upload.php, upload.php, media.php and post.php, can't figure it out. Am I overlooking something?

  2. realchaos1
    Member
    Posted 14 years ago #

    Figured it out, here's for future reference.

    edit: wpmu-functions.php

    find

    /* Misc functions */
    function fix_upload_details( $uploads ) {
    	$uploads['url'] = str_replace( UPLOADS, "files", $uploads['url'] );
    	$uploads['baseurl'] = str_replace( UPLOADS, "files", $uploads['baseurl'] );
    	return $uploads;
    }

    rename "files" to the new directory.

    :)

  3. stix1972
    Member
    Posted 14 years ago #

    IS there anywhere where there is a tutorial to exactly get this done.

    I changed the Blog.fir to files and still can not find it in the right folder after uploading a file

    Or does anyone know of a good way to file uploads offsite to easily put in the write post pafe. I tried imagstack and it is not working either.

  4. djSonline
    Member
    Posted 14 years ago #

    You may be talking about uploading through Media option in Admin panel.
    If so then here is the simple solution.

    Go to Settings -> Miscellaneous
    there will be upload settings.

    ;-)

  5. megahec
    Member
    Posted 13 years ago #

    Hi Realchaos1,
    I did not find out the function 'fix_upload_details' in wpmu-functions.php. My wp-mu version is 2.9.2 so it might be changed to another name. I tried to search the function name in all WP-MU'S folders but it isn't out there. Could you or someone else kindly help me to solve this problem?
    Thanks.

  6. cecilporter
    Member
    Posted 13 years ago #

    I want to change the config so uploads are NOT sorted into sub-folders based on the date. I want them ALL in the /uploads/ folder.

    Like @djSonline, I thought this would be easty, but using WordPress MU 2.9.2 (and 2.9.1.1 on another test installation) I do not have a Settings -> Miscellaneous options page.

About this Topic

  • Started 14 years ago by realchaos1
  • Latest reply from cecilporter