WordPress.org

Forums

[resolved] Media uploads going to /files (9 posts)

  1. pgardella
    Inactive
    Posted 1 year ago #

    We are running WP Multisite on 3.6.1 and haven't had a problem until yesterday afternoon. We are doing sub-domain for our multisite.

    Now, when we upload the files for *one* of our multisite installations (the primary domain), it puts the files in the <doc_root>/files directory rather than <doc_root>/wp-content/blogs.dir/2/files folder. The exact same image gets put into the correct blogs.dir folder for the rest of the domains, so it is one blog out of seventeen that have this problem.

    Before I go through the process of turning off/on plugins, can anyone think of why this might be the case? If it was more than one blog, I'd look at the .htaccess file, etc.

    Patrick

    P.S. We've made blog with ID #2 the primary domain now, rather than #1. That was done yesterday afternoon, so it might be related.

  2. They're supposed to go to /files/

    http://codex.wordpress.org/Multisite_Network_Administration#Uploaded_File_Path

    If you started on Multisite 3.4 or older, your images always were suppose to go to /files/ - This is not, nor has it ever been, an error.

    What's in your .htaccess?

  3. pgardella
    Inactive
    Posted 1 year ago #

    From that link, they are supposed to *show* on that path, but they are actually uploaded to /wp-content/blogs.dir/2/files.

    They show (used in the img src tag, that is) under files just fine. The problem is that the php that displays the files in /files/ is looking for them under /wp-content/blogs.dir/2/files/ and not finding them so they get a 404.

    If I manually move the files to /wp-content/blogs.dir/2/files/ it works perfectly, and displays the images under /files/, just like it is supposed to.

    Here is my .htaccess file as requested though...

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule . index.php [L]
    ~
  4. From that link, they are supposed to *show* on that path, but they are actually uploaded to /wp-content/blogs.dir/2/files.

    Correct. They show domain.com/subsite/files/2013/10/image.jpg but load from the blogs.dir/2 folder.

    The problem is that the php that displays the files in /files/ is looking for them under /wp-content/blogs.dir/2/files/ and not finding them so they get a 404.

    Are you saying that WP is actually making a /files/ folder and putting the files there?

  5. pgardella
    Inactive
    Posted 1 year ago #

    Correct. WP is making a /files/ folder and putting files there.

    The files we uploaded this AM are:
    /files/November-2013-1280x800.jpg
    /files/November-2013-1440x900.jpg

  6. Well that's not even close to normal.

    So what changed 6 days ago? You're still on 3.6.1, did you upgrade any plugins or themes?

    Is this happening on ALL sites or just one subsite?

  7. pgardella
    Inactive
    Posted 1 year ago #

    Right :)

    Yes, we updated a few plug ins. I was going to debug the plugins next, but wanted to see if there are any problems that were known.

    This only happens on a single subsite, which will make it easier to debug the plugins.

    If you can't think of any other reason why this would be happening, I'll start debugging the plugins.

  8. Two things could cause it (well, they're the most likely).

    1) plugin overriding settings
    2) someone edited the upload file path in the network settings for that site

    Option 1 is far more likely. Only super admins can change the upload path and you SHOULD have far fewer of those than site admins ;)

    Also check if your theme updated recently.

  9. pgardella
    Inactive
    Posted 1 year ago #

    It was the upload path in network settings. I'm going to assume that it was a plugin overwriting that, as I really doubt any of the super admins would know how to change that.

    It's fixed now! Thank you.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.