• Resolved Sushyant

    (@zavarzadeh)


    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?

Viewing 15 replies - 1 through 15 (of 19 total)
  • 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]

    Thread Starter Sushyant

    (@zavarzadeh)

    not work yet!!! only can upload photo

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Go to SuperAdmin -> Options

    Scroll down to Upload Settings

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

    Thread Starter Sushyant

    (@zavarzadeh)

    thats available for pdf zip mp3 doc jpg png etc

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    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.

    Thread Starter Sushyant

    (@zavarzadeh)

    mp3 size is 68 kb

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

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

    Thread Starter Sushyant

    (@zavarzadeh)

    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

    Then you’ll have to bump up the internal redirects.

    Thread Starter Sushyant

    (@zavarzadeh)

    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.

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

    Thread Starter Sushyant

    (@zavarzadeh)

    they said must myself repair it 🙁

    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.

    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]
    Thread Starter Sushyant

    (@zavarzadeh)

    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 :((

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Error saving media attachment. in wp3’ is closed to new replies.