The MU forums have moved to WordPress.org

Problem with file attachments (11 posts)

  1. barlowrm
    Member
    Posted 16 years ago #

    Hi all,

    we are having an annoying problem with file attachments. Here is what happens

    1) The attach process itself runs smoothly, and the uploaded files are nicely put into wp-content/blogs.dir/and/so/on

    2) The uploaded files are *not* accessible through urls in the form wp-content/blogs.dir/and/so/on

    3) They are *not* accessible through the permalinks either (mySite.org/aBlog/files/and/so/on)

    4) my .htaccess is

    RewriteEngine On
    RewriteBase /
    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.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]
    RewriteRule . index.php [L]

    and if I comment out the two lines involving "files", then problem 2) disappears, while of course I still have problem 3).

    I guess 1) plus 4) means that it must be some weird rewrite issue, and the permissions in wp-content are actually fine.

    Unfortunately I am no apache expert...

    Is there anybody willing to suggest some fix?

    Thanks in advance,

    Andrea.

    PS: sorry about the "and/so/on", if you need more details just ask and I'll post them

    PPS:

    $wp_version = '2.3.3';
    $wpmu_version = '1.3.3';
    $wp_db_version = 6124;

  2. barlowrm
    Member
    Posted 16 years ago #

    Sorry, I should have mentioned that by "not accessible" in my previous post I mean that I get a 500 internal server error when trying to use the urls.

  3. prazim
    Member
    Posted 16 years ago #

    I am having essentially the same problem but didn't think it was in issue with my .htaccess file.

    The images are residing in the right directory after upload and the html points correctly to the file, but instead of the image, I get the file description.
    Thanks,
    Sue

  4. prazim
    Member
    Posted 16 years ago #

    well, I got sufficiently exasperated this evening to really dig in and discovered that there are 11,800 related posts on this topic! It turns out, that there are two files which need editing, potentially. I edited both, and FINALLY my blog is working correctly.

    The first step is to edit the http.conf file. The link explaining what syntax to include is located here:
    http://mu.wordpress.org/forums/topic.php?id=5351&page&replies=8

    The second is to confirm the syntax of your .htaccess file. The correct syntax is located here:
    http://mu.wordpress.org/forums/topic.php?id=7392&page&replies=11

    I have to say that as much as I perceive WordPress to be the preferable blog platform, someone had a major oversight in not including this information in the directions which are included with the MU zip file. I hope for the sake of those who come after and the wearied forum admins, the install directions are properly amended.

  5. lunabyte
    Member
    Posted 16 years ago #

    "I have to say that as much as I perceive WordPress to be the preferable blog platform, someone had a major oversight in not including this information in the directions which are included with the MU zip file. I hope for the sake of those who come after and the wearied forum admins, the install directions are properly amended."

    Sorry, but you need to READ them. They're there.

    Second thing under "Apache"
    http://trac.mu.wordpress.org/browser/trunk/README.txt#L21

    Next, your "htaccess" problem. Know what's posted in your second reference? The default htaccess file that MU writes when it's installed.

    Know what the moral of this post is?

    Donncha shouldn't be held accountable for users shortcomings in reading the provided documentation.

    So, I'll have to politely disagree that it's not the install directions.

  6. barlowrm
    Member
    Posted 16 years ago #

    Hi,

    maybe I was not clear enough in my original post: I AM using "default htaccess file that MU writes when it's installed".
    The problem is that it's not working anyway.

    I don't have access to http.conf, since I am not on a private server.

    Moreover, please notice that my problem is quite different from the similar ones I could find on the forums:

    1) I don't get a 404 but a 500
    2) the "non-rewritten" links don't work either (point 2 in my original post)

    Does anybody have any suggestion?

    Thanks for your help,

    Andrea.

  7. andrea_r
    Moderator
    Posted 16 years ago #

    Well, you're going to have to talk to your host. If you can't get to the files either way, and it's a 500 error, then it's on the server side.

  8. barlowrm
    Member
    Posted 16 years ago #

    Thanks andrea_r, I just wanted to be sure it was not a known issue.
    I have just filed a ticket on the support site of my host.
    I'll post here the outcome...

    Thanks for your help,

    Andrea.

  9. barlowrm
    Member
    Posted 16 years ago #

    Hi,

    so it turns out there was some permission problem and my host has now fixed this.

    Unfortunately, it looks like the files I get back from wpmu are somehow corrupted.

    Here is what I do:

    1) upload a file
    2) wget it back
    3) check the md5sum of the two files

    The md5sum are different. In the case of pdf files, acroread complains that the file is now corrupted and cannot read it.

    The file I get back from the site is not truncated, as far as I can tell: the size is the same as the original file.

    Moreover, the file stored on the site is not corrupted: if I copy it locally with ftp I can open it without problems.

    Do you have any suggestion?

    Thanks for your help,

    Andrea.

  10. barlowrm
    Member
    Posted 16 years ago #

    Hi,

    I have more info.

    If I wget the attached pdf through the url in the form wp-content/blogs.dir/and/so/on, the file is ok.

    It is corrupted only if I wget it from "re-written" addresses.

    Do you have any clue?

    Thanks,

    Andrea.

    btw: in order to use the "true" urls (wp-content/blogs.dir/and/so/on) I have to comment the two RewriteRules involving "files", otherwise the true url (which contains "files") gets rewritten to something which does not exist and I have a 404. Is this the expected behavior?

  11. barlowrm
    Member
    Posted 16 years ago #

    Ok, solved. Some spurious "echo" was inserted (by me...) in blogs.php before the call to readfile, leading to file corruption. Now everything works fine.

    Cheers,

    Andrea.

About this Topic

  • Started 16 years ago by barlowrm
  • Latest reply from barlowrm