WordPress.org

Ready to get started?Download WordPress

Forums

Change destination for upload files (17 posts)

  1. TopDog
    Member
    Posted 8 years ago #

    In WordPress 1.5.x you could change the destination directory for uploads under Options and Miscellaneous like this. But I cannot for the life of me find the same setting in WordPress 2.0 ???

  2. ttech5593
    Member
    Posted 8 years ago #

    I'll show you how to fix it, but give me a little time to get it to you... Thanks

  3. Nikki
    Member
    Posted 8 years ago #

    There is a plugin that might help: http://www.ilfilosofo.com/blog/old-style-upload/

  4. spencerp
    Member
    Posted 8 years ago #

    Why not just do what I did here:
    http://wordpress.org/support/topic/54113?replies=17#post-296735

    Works good in my WP Version 2.0. All you gotta do basically is reupload the options-misc.php file located in the wp-admin folder, from say the WP 2.0 Beta RC3 version or a previous version of say 1.5.2. Hope this helps maybe.. =)

    Open the wp-admin/options-misc.php file you have of whatever version you might have, delete all of it. (Do this from on the hard drive, or computer.)

    Click this link, select all, copy it.
    Paste it into the Version 2.0. or whatever version you have now, of the wp-admin/options-misc.php file. Save it, then reupload to the wp-admin directory.
    http://www.vindictivebastard.net/options-misc.php.txt

    spencerp

    P.S. CHMOD the wp-content and any "upload" folder 777. Example folders to upload into: "uploads", "images","pics" whatever you want, make them 777. And don't forget to do that with the wp-content folder as well. =)

  5. ttech5593
    Member
    Posted 8 years ago #

    Also there's a little code you can edit and make the new upload tool use your directory (if you want to do that I'll tell you). Personally I use PHPFM and got it working with 2.0, that's what I use to upload...

  6. spencerp
    Member
    Posted 8 years ago #

    ttech5593, hmmm....that sounds interesting lol. =) I'm up for it hehe. I'm one that likes to experiment around and stuff lol! =)

    spencerp

  7. ttech5593
    Member
    Posted 8 years ago #

    If I get you correctly you don't want to do that or do? Thanks...

  8. spencerp
    Member
    Posted 8 years ago #

    @ttech5593, Yeah... I want to do it. =) That's what I meant by: "I'm up for it hehe. I'm one that likes to experiment around and stuff lol! =)"

    spencerp

  9. ttech5593
    Member
    Posted 8 years ago #

    Yeah sorry, o.k then. Here it goes... :-)
    Back-up the wp-includes directory (all of it) if you want to do PHPFM too then also backup wp-admin directory. Just to be safe... Once your done open wp-incldes/functions-post.php (you need a program that numbers the php code lines + edits) after that, find line #838 (all starts there)should look something like "
    function wp_upload_dir() {
    if ( defined('UPLOAD') )
    $dir = UPLOAD;
    else
    $dir = 'upload';"
    upload is the directory I have for uploads you can change it if you'd like to what you want but if it's something like folder/upload_dir, change the second $dir = 'upload';" after the else if it does not change try the other... Next : changing how it organises uploads, go to line (after testing) 859 and you should see this : $time = current_time( 'mysql' ); and then select everything from like 859 to 863 and if you want the upload tool just to create a folder with the year not a year folder with a month folder then with what you've selected past this instead "
    $time = current_time( 'mysql' );
    $y = substr( $time, 0, 4 );
    $m = substr( $time, 5, 2 );
    $pathy = "$path/$y";
    $pathym = "$path/$y";"
    make sure that that $time lines up with $y.
    Tell me if you don't under stand this, it may be confusing. Thanks...

  10. ttech5593
    Member
    Posted 8 years ago #

    Hope that's not too badly written... Thanks...

  11. Kafkaesqui

    Posted 8 years ago #

    ttech5593, your changes to functions-post.php are not really necessary. Note where the code you quote says if ( defined('UPLOAD') ) -- this checks if the PHP constant UPLOAD has been set, or "defined."

    You can set this constant in your wp-config.php and thereby reset where uploads are sent and avoid any editing of WP's core source files.

    As an example, here's what I have in my wp-config.php:

    define('UPLOADS', '/images');

    Just make sure it occurs before this line:

    require_once(ABSPATH.'wp-settings.php');

  12. billh
    Member
    Posted 8 years ago #

    If it's just form uploading images, you can use the Iimage Browser plugin and select the directory to upload the image to from the upload interface.

  13. spencerp
    Member
    Posted 8 years ago #

    Or you could just do what I said to begin with and upload the wp-admin/options-misc.php file from like version 1.5.2 or version 2.0 RC3 Beta, to inside the wp-admin folder in the blog's directory.

    You'd have that upload field back again in under:
    Options => Miscellaneous Options

    And it will work just fine in Version 2.0. =) Like I also said, I did it with my blog running 2.0, and it works awesomely. It's only the one file to upload, jeesh lol!

    spencerp

  14. ttech5593
    Member
    Posted 8 years ago #

    Yeah... Thought so. Had a feeling tha I said something wrong. Thanks for saying something...
    Also some of what I wrote was so the new upload tool does not add the folder for each month, it just adds the folder for the year...

  15. ttech5593
    Member
    Posted 8 years ago #

    Oh, cool... At least there are options to choose from oh how to change WP's upload directory.

  16. spencerp
    Member
    Posted 8 years ago #

    ttech5593, it's ok lol. I was just really busy lastnight working on my Andreas08 theme. =) However, I did read that reply though, and was scratching my head, wondering why go through all that, when you could just do what I had said before. =)

    But, I realize now what you were "specifying" on this:
    "Also some of what I wrote was so the new upload tool does not add the folder for each month, it just adds the folder for the year..."

    Which for me, I usually use just one folder, which isn't listed in under my wp-content folder. I just upload all my imagery into the one outside the blog's folders right inside the root and call it up by domain.com/"imagefolder" /whatever.gif or whatever.

    So, me hard coding that file, really wouldn't be necessary. Sorry about that.. =)

    spencerp

  17. ttech5593
    Member
    Posted 8 years ago #

    OK. Actually I did that is my blog has lots of files so if It's in one folder it would get too cluttered. Also it makes it easier to find files from a year using PHPFM (really good almost no install) and file viewer. So you just went with the old upload options file. It is my first post that I really tried to help on, think I still need a bit of work on the instructions :-)

Topic Closed

This topic has been closed to new replies.

About this Topic