WordPress.org

Forums

[resolved] Files won't upload in WP 3.01 (10 posts)

  1. hlr
    Member
    Posted 4 years ago #

    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

  2. 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?

  3. hlr
    Member
    Posted 4 years ago #

    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.

  4. 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? :)

  5. hlr
    Member
    Posted 4 years ago #

    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>

  6. 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>
  7. hlr
    Member
    Posted 4 years ago #

    Hi,

    I'll try that and report back. Thanks!

    Hans

  8. hlr
    Member
    Posted 4 years ago #

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

  9. bybeach
    Member
    Posted 4 years ago #

    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.

  10. 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.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags