• Resolved hlr

    (@hlr)


    Hi,;
    I’m running WP 3.0.1, a multisite installation that was upgraded from a previous MU installation. Serious problem: Files can’t be uploaded.
    – When attaching a file to a message, the resulting link gives a 404.
    – Same thing happens when adding to media library.
    – But it is there – I can see it on the server, under blogs.dir/xx
    Any idea on how to solve this?
    CU
    Hans

Viewing 9 replies - 1 through 9 (of 9 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Are you saying

    1) When I try to upload files, the uploader doesn’t work. — If so, please attach an error message.

    or

    2) I can upload images, but they don’t show up in my posts. — If so, are you using subfolder or subdomain multisite, and what’s in your .htaccess?

    Thread Starter hlr

    (@hlr)

    1. No error message – just a 404 when trying to access the link that is proposed by WP
    2. Subfolders. And I didn’t change anything in .htaccess.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    So you’re saying ‘I can upload images, but they don’t show up in my posts.’ or basically ‘Images upload, links don’t work.’ Which usually is an .htaccess issue.

    Which brings us back to this: what’s IN your .htaccess? 🙂

    Thread Starter hlr

    (@hlr)

    Hi,

    As I said: I didn’t change anything. This is what it says:

    RewriteEngine On
    RewriteBase /blogs/

    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
    RewriteRule ^(.*/)?files/(.*) wp-includes/ms-files?file=$2 [L]

    # add a trailing slash to /wp-admin
    RewriteCond %{REQUEST_URI} ^.*/wp-admin$
    RewriteRule ^(.+)$ $1/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule . – [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    <IfModule mod_security.c>
    <Files async-upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </Files>
    </IfModule>

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    I wasn’t asking if you’d changed anything. 🙂

    That said, the fact that you upgraded from MU and did not change anything means you missed a step. A crucial one, in fact. You SHOULD have replaced the line with blogs.php to ms-files.php, which it looks like you did with a typo. You left off the .php extension. Which is most likely at fault here.

    Use this .htaccess:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /blogs/
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    </IfModule>
    # END WordPress
    
    <IfModule mod_security.c>
    <Files async-upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </Files>
    </IfModule>

    Thread Starter hlr

    (@hlr)

    Hi,

    I’ll try that and report back. Thanks!

    Hans

    Thread Starter hlr

    (@hlr)

    Hi,
    Yes, that took care of the problem. Many thanks!
    Hans

    I am so glad people are getting this sorted – but I am a NON TECHNICAL WordPress user and have no idea where/how to make any permission changes/htaccess adjustments or php alterations in order to get images to upload into my wordpress site.

    Here is the error message:

    “image.jpg” has failed to upload due to an error
    The uploaded file could not be moved to d:\inetpub\ingall/wp-content/uploads/2010/10

    NOTE:
    In Settings/Media the ‘Uploading Files’ area is set to: wp-content/uploads

    When I ADD a ‘/’ in front of wp-content/uploads – the error message changes to:

    “image.jpg” has failed to upload due to an error
    Unable to create directory /wp-content/uploads/2010/10. Is its parent directory writable by the server?

    Should I re-install WordPress entirely?
    Is the problem due to the WP Theme or WP overall?
    Any tips for my simple brain?

    Thanks to anyone who can help.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    bybeach – You’re on an IIS (aka Windows) server, which means this is a different error.

    Read http://www.lauragentry.com/wordpress/?p=517

    If that doesn’t help, make a NEW post.

    but I am a NON TECHNICAL WordPress user and have no idea where/how to make any permission changes/htaccess adjustments or php alterations in order to get images to upload into my wordpress site.

    Just as a heads up, this may cause you problems down the line. MultiSite is harder than regular WordPress, and you’re going to have an even worse time getting help because you’re on IIS (aka Windows) server.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Files won't upload in WP 3.01’ is closed to new replies.