Support » Multisite » Multisite uploads in a differnt folder

Multisite uploads in a differnt folder

  • I know there are similar posts, but I have turned up none that really address this issue:

    I would like to have all the uploads for one of my multisites reside in a folder on the same server but outside the wordpress directory. E.g. in mysite.com/foo/files instead of mysite.com/wordpress/wp-content/blogs.dir.

    I tried to change the settings Network Admin>Sites>Settings. The two settings I changed were:
    Upload Path: ../foo/files
    Fileupload URL: http://mysite.com/foo/files

    However, when I try to upload images, I get an error about permissions on the default folder, /wp-content/blogs.dir. (I can’t make that writable, which is one of the reasons I want to use a different folder.)

    Is it possible to have images in a file outside the wordpress directory? If not, is there a way to reset the Settings for this blog?

Viewing 15 replies - 1 through 15 (of 15 total)
  • You should try a full path for your upload path: /home/rubysue/files/

    That said? You’d be better off trying to put a blogs.dir in there instead, having it be /home/rubysue/blogs.dir/1/files/

    That would keep the sites separate.

    (Why can’t you make the blogs.dir writable? Have you tried adding in

    define('FS_CHMOD_DIR', (0755 & ~ umask()));
    define('FS_CHMOD_FILE', (0644 & ~ umask()));

    or something similar to your wp-config.php to give WP the permissions it needs?)

    Okay, I suspected as much. I’ll try the wp-config and report back.

    I also have a ticket submitted to my host to ask them to set the permissions on wp-content to 775. Should that be recursive to files and folders?

    Finally, just to double check, I’m going to put the upload path back to /wp-content/blogs.dir/#/files/. Should the fileupload url be `mysite.com/wordpress/wp-content/blogs.dir/#/files/’?


    The fileupload should be mysite.com/wordpress/files/ actually. There’s a bit of magic that redirects 🙂

    I also have a ticket submitted to my host to ask them to set the permissions on wp-content to 775. Should that be recursive to files and folders?

    They won’t let you change the permissions? You’re gonna have a lot of issues running a website (including upgrading plugins and themes… and possible WP itself). Have them ONLY change the permissions on wp-content/blogs.dir

    Why are they so restrictive? Is this a function of the kind of PHP setup they have?

    Well, they run PHP in safe mode. It’s a university.

    If I were going to ask for the broadest permissions change (with the least work for them) would asking for 775 on the entire wordpress directory be wise?


    Well, they run PHP in safe mode.

    Ouch. Ouch. Okay, you will have a LOT of problems. Not with plain WordPress (out of the box, it actually works fine), but with some plugins :/

    Don’t make the whole wordpress directory 755, that’s unsafe. You only should need wp-content/blogs.dir

    But the code suggestion I put up?

    define('FS_CHMOD_DIR', (0755 & ~ umask()));
    define('FS_CHMOD_FILE', (0644 & ~ umask()));

    That lets WP upload with special permissions, and since it does that running as the PHP admin, you should be able to use that and upload images without issue.

    Tried that, but it still fails. I cleared the cache on my browser…Is there some sort of tmp folder in WordPress I should clear too?

    What’s the error you’re getting?

    “Photo.png” has failed to upload due to an error
    Unable to create directory /export/httpd/data/wordpress/wp-content/blogs.dir/2/files. Is its parent directory writable by the server?

    Silly question … Can you upload for site #1?

    Not silly, and no:
    Warning: copy() [function.copy]: SAFE MODE Restriction in effect. The script whose uid is 10055 is not allowed to access /export/http/data/wordpress/wp-content/uploads owned by uid 2895 in /export/httpd/vhosts/soa/data/wordpress/wp-admin/includes/file.php on line 348

    Warning: copy(/export/httpd/data/wordpress/wp-content/uploads/Census2010.png) [function.copy]: failed to open stream: No such file or directory in /export/httpd/data/wordpress/wp-admin/includes/file.php on line 348

    *sigh* I’m going to kick your IT department in the knee a lot.

    Can you get them to add your ID to the group that has access, perhaps? Normally you add the IDs to the apache group so they can write files etc.

    Well, I have a ticket in. You would think they would allow webmasters write permissions, no? We’ll see.

    So here’s the problem now. It seems that when WordPress creates the new directory under blogs.dir, it sets the owner to ‘www’. So it then can’t write to that directory (since it’s running with my ftp credentials).

    That’s not WP, that’s PHP. I mean, WP is making the directory via PHP, which is okay, and that SHOULD be uploading images under the same account.

    What you need is to get YOUR id added to the www group!

    Thanks! Working on it. Appreciate your help.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Multisite uploads in a differnt folder’ is closed to new replies.