WordPress.org

Ready to get started?Download WordPress

Forums

uploads folder outside WP root? (13 posts)

  1. beku76
    Member
    Posted 6 years ago #

    hi,
    is there a way to change the uploads folder to one outside the wordpress installation folder?

    from:
    http://www.domain.com/wordpress/wp-content/uploads

    to:
    http://www.domain.com/media/uploads

    default:
    domain
    -wordpress
    --wp-content
    ---uploads

    I need:
    domain
    -media
    --uploads
    -wordpress
    ...

    I tried to change the option in the settings, but I did not succeed :(

    thanks for your help

  2. haochi
    Member
    Posted 6 years ago #

    I am not sure if this will work (theoretically, it should) but don't feel like trying it on my blog:
    Settings -> Miscellaneous -> Store uploads in this folder => '../media/uploads' if /media and /wordpress are on the same directory.

  3. beku76
    Member
    Posted 6 years ago #

    thanks for the hint,
    but it doesn't work :(

    using this suggestion, WordPress creates a folder named ".." under WordPress directory

    like this:
    domain
    -wordpress
    --..
    ---media
    ----uploads

  4. haochi
    Member
    Posted 6 years ago #

    Oops, sorry, it should've been '/../media/uploads', give it one more try. (Turns out that I can't upload files on my WP, doesn't matter to me thought because I use FTP to upload files.)

  5. chriskalani
    Member
    Posted 6 years ago #

    I have been trying to figure this out too. It was easy to do before 2.5... I posted the solution here: http://chriskalani.com/archive/upload-outside-of-the-wordpress-directory/

    But that no longer works... :( I really need to find a solution.

  6. beku76
    Member
    Posted 6 years ago #

    finally it worked for me,
    the links inside the posts look like:

    http://www.mydomain.com/wordpress/../media/uploads/photo1.jpg

    but,
    The image is stored at:
    http://www.mydomain.com/media/uploads/photo1.jpg

    I found that the browsers correct this by default.
    they know that /../ means -1 level
    Try it yourself, with any image found in google like this:
    http://images.pingmag.jp/images/title/wordpresstitle.jpg

    now, modify the url to:
    http://images.pingmag.jp/whatever/../images/title/wordpresstitle.jpg
    and copy it to the browser again,
    voila! it goes to the original one.

  7. creativeworldstudio
    Member
    Posted 5 years ago #

    I'm trying to move the default folder outside of the wordpress/ install directory and into the / root of the site too. Any tips on how this can be done??

    @beku76 - can you explain your solution more please?

  8. creativeworldstudio
    Member
    Posted 5 years ago #

    anyone out there have a solution for this?

  9. yarntomato
    Member
    Posted 5 years ago #

    I have found the solution for this.

    Settings -> Miscellaneous
    Do both of the following:

    Store uploads in this folder -> absolute path to folder you want to use
    Example: /home/user/public_html/images

    Full URL path to files -> actual URL of folder you want to use
    Example: http://www.example.com/images

    Note: As shown in the examples above, do not use a trailing slash.

    How to find your absolute path:
    Using a text editor (such as Notepad), copy and paste the following code, and save it as path.php

    <?php
    $p = getcwd();
    echo $p;
    ?>

    Upload path.php to the folder you want to use, then open it in a web browser (example: http://www.example.com/images/path.php). It will display your absolute path.

  10. creativeworldstudio
    Member
    Posted 5 years ago #

    @yarntomato

    THANK YOU!!! Your solution worked perfectly. Many thanks!

  11. chriskalani
    Member
    Posted 5 years ago #

    Awesome! Works great for 2.5+

  12. stereosushi
    Member
    Posted 5 years ago #

    Hello, old topic but i searched this on google and found.
    I tried to change the path and url and also copied my old images to new folder but its funny that images on gallery inside my posts sits on the new directory, others not.
    i dont know why

  13. elvanja
    Member
    Posted 5 years ago #

    Hi!
    Any ideas about placing upload folder on another server?

    Namely, I tried defining upload folder location as seen from media server (the other one, using path.php), but although the URL is right and visible from WordPress server, the only thing I get is just another folder in WP root and that of course is not correct.

    I would actually need for WP to upload files to this other server and use them in posts like they were on WP side of the story.

    Any help appreciated!

Topic Closed

This topic has been closed to new replies.

About this Topic