WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Error saving media attachment. in wp3 (20 posts)

  1. Sushyant
    Member
    Posted 3 years ago #

    I have a problem with upload media in wordpress 3
    when i want upload an music or video i see this eror message:

    Error saving media attachment.

    in my wp 3 just work upload photos

    when i wanted update my wpmu 2.9.2 to wp3 i saw this messages:

    Warning! WordPress encrypts user cookies, but you must add the following lines to wp-config.php for it to be more secure.
    Before the line /* That's all, stop editing! Happy blogging. */ please add this code:

    define( 'NONCE_SALT', 'y<nnK<A220t7&#>rhO,b0Pqj?%J67:`VxZYN]d|&k62N+tyZhi6bg}nweY=YsqYP' );
    The wp-content/blogs.php file is deprecated. Please remove it and update your server rewrite rules to use wp-includes/ms-files.php instead.

    i think this is reason of my problem because:

    blogs.php and ms-files.php have difference codes
    upload file location is blogs.dir and this name is same of blogs.php

    any one can help me?

  2. Person
    Member
    Posted 3 years ago #

    Read the instructions...
    1) add the salt line to wp-config.php
    2) Delete wp-content/blogs.php
    3) In your .htaccess file, change this line:
    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]
    To this:
    RewriteRule ^(.*/)?files/(.*) wp-includes/ms-files.php?file=$2 [L]

  3. Sushyant
    Member
    Posted 3 years ago #

    not work yet!!! only can upload photo

  4. Go to SuperAdmin -> Options

    Scroll down to Upload Settings

    Make sure the type you're trying to upload is on the approved list.

  5. Sushyant
    Member
    Posted 3 years ago #

    thats available for pdf zip mp3 doc jpg png etc

  6. And you're trying to upload a 'what' file? :)

    Also, do apply the Nonce key to your wp-config.php file. If WP is telling you to do that, you really should.

  7. Sushyant
    Member
    Posted 3 years ago #

    mp3 size is 68 kb

  8. Check your error_log on your server. See if there's something that explains it. Or elaborates on it.

  9. Sushyant
    Member
    Posted 3 years ago #

    Sun Aug 01 09:35:39 2010] [error] [client 68.71.132.67] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://domain.com/wp-admin/upload.php?message=3

  10. Then you'll have to bump up the internal redirects.

  11. Sushyant
    Member
    Posted 3 years ago #

    how can repair it?
    i think thats eror is from my .htaccess. my .htaccess is for wpmu 2.9.2

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    RewriteCond %{HTTP_HOST} ^www\.(.*)
    RewriteRule ^(.*) http://%1/$1 [R,L]

    #RewriteCond %{REQUEST_FILENAME} !-f
    #RewriteCond %{REQUEST_FILENAME} !-d
    #RewriteRule . /index.php [L]

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

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    i changed line 15 for multisite.

  12. Your internal redirects are not controlled by the htaccess file. Talk to your web host.

  13. Sushyant
    Member
    Posted 3 years ago #

    they said must myself repair it :(

  14. dgilmour
    Member
    Posted 3 years ago #

    I'm no expert in the range of .htaccess file settings for Multisite, but I don't understand why your "#uploaded files" section includes this line:

    RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*

    I can't think of a connection between uploaded files and the plugin directory, so checked my .htaccess and I don't have this line. Now wondering how it got there...

    My #uploaded files section:

    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteRule ^(.*/)?files/(.*) wp-includes/ms-files.php?file=$2 [L]

    Can someone advise if there could be a reason for it?

    Similarly, you have 2 more rewrite conditions than I have, before the final rewrite rule; these ones:

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    Hopefully someone will be able to confirm if these are wrong. Meantime it might be worth trying commenting out these lines to see if it helps.

  15. spherical
    Member
    Posted 3 years ago #

    Redirects are controlled by .htaccess. Or, more specifically, a mal-formed .htaccess can cause internals to kick in and go blooey. I've eliminated them many times by realizing that my rewrites were Borked.

    To begin with, there are way too many conditions and rules in the .htaccess file.

    Temporarily comment these out:

    RewriteCond %{HTTP_HOST} ^www\.(.*)
    RewriteRule ^(.*) http://%1/$1 [R,L]

    They may work but I don't do it that way and it may be causing something else to go wrong.
    ^www\.(.*)
    is what is known as greedy and can lead to unexpected results. Get down to the basics first and then elaborate later.

    Then, this is commented out and then re-inserted at the bottom:

    #RewriteCond %{REQUEST_FILENAME} !-f
    #RewriteCond %{REQUEST_FILENAME} !-d
    #RewriteRule . /index.php [L]

    I'm not exactly sure where they came from in the first place. The "!" negated the test. Leave them out.

    These two lines are from WPMu2.x and earlier:

    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*

    Apparently, they can be eliminated with WP3.x.

    The resultant WordPress section should then only contain these lines; and the trailing slash rules are optional:

    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteCond %{REQUEST_URI} ^.*/wp-admin$
    RewriteRule ^(.+)$ $1/ [R=301,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]
  16. Sushyant
    Member
    Posted 3 years ago #

    thats not work!!!
    how ever i see this now http://wordpress.org/support/topic/issue-with-upload-files-path?replies=5

    i change my .htaccess with

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    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]
    </IfModule>

    # END WordPress

    now i can upload all files but cant upload video or music files like mp3 wave etc :((

  17. Are those file types allowed in Super Admin -> Options?
    Do you have enough upload space set?

  18. Sushyant
    Member
    Posted 3 years ago #

    yes those files types allowed
    and i have enough upload space

  19. Check with your webhost.

    This is a shot in the dark, but THEY may have killed uploads of that type. I recall SimpleNet did once, back when they got bought out by Yahoo.

  20. progresst
    Member
    Posted 3 years ago #

    I had the same problem and found it was the way I setup my domain in plesk. When enabling PHP, make sure it is NOT running in Safe Mode. I disabled safe mode and it work perfectly...good luck!

Topic Closed

This topic has been closed to new replies.

About this Topic