Support » Plugin: Relocate Upload » [Plugin: Relocate Upload] Sub directories are not made before moving

  • Resolved shawnpyle


    Default folder: [project root]/wp-content/uploads/%YEAR%/%MONTH%/
    MP3 folder: [project root]/wp-content/uploads/mp3/%YEAR%/%MONTH%/

    However, when I go to move a file, the mp3 directory is made but none of the sub directories and was causing this error:
    Warning: rename([project root]/wp-content/uploads/2012/09/test.mp3, [project root]/wp-content/uploads/2012/09/test.mp3) [function.rename]: No such file or directory in [project root]/wp-content/plugins/relocate-upload/relocate-upload.php on line 52

    I was able to solve this by adding the following to the relocate-upload.php file starting on line 49 before the // attempt to move the file:

    // create directory if needed
       $new_dir = dirname($new_path);
       if(!file_exists($new_dir)) mkdir($new_dir,0777,true);

  • The topic ‘[Plugin: Relocate Upload] Sub directories are not made before moving’ is closed to new replies.