The MU forums have moved to WordPress.org

Media Image not showing (14 posts)

  1. benzwu
    Member
    Posted 15 years ago #

    I have a MU installation, sub folder type not sub domain.

    All users can upload the media file, like images. But after uploaded the image is not properly served to users. Just blank or a box with a x mark on it.

    I checked the files are uploaded successfully.

    based on .htaccess the requests are redirected to blogs.php and then blogs.php will return the header and read the actual file.

    Somehow those files are corrupted when served. Any of you experienced this issue?

    You help appreciated

  2. musnake
    Member
    Posted 15 years ago #

    Can you display the image directly using the URI (view image via link in browser)? If not, you may have hotlinking prevention enabled on your account and/or .htaccess drama (have you changed it recently?)

    What have you tried?

  3. benzwu
    Member
    Posted 15 years ago #

    I can't open the image directly to /wp-content/blogs.dir/12/files/2008/08/dcpress.jpg

    the result is 404 file not found.

    you can try open this file on the "official"

    http://blog.dhammacitta.org/dhammacittapress/files/2008/08/dcpress.jpg

    the interesting part is, when I remove the header part in blogs.php, the file served but not as a valid image file.

    I don't have any hotlinking enabled nor .htaccess unusual stuff.

  4. musnake
    Member
    Posted 15 years ago #

    And the permissions (group and owner too) are all ok?
    0755 for dirs and 0644 for files (although I recognize that this depends on other system settings, but generally speaking...)

    The file is located here?
    http://blog.dhammacitta.org/wp-content/blogs.dir/12/files/2008/08/dcpress.jpg

    So you have a subdirectory installation under "blog"
    with a sub-blog for "dhammacittapress"

    Hmm, not as a valid image file... maybe it's an Apache mime type handler issue?
    In .htaccess
    AddType image/jpeg .jpg .jpeg which should already be in Apache's mime.types file.

    Honestly, I've never used a sub-dir install so I should shut up right about Line 1.

  5. benzwu
    Member
    Posted 15 years ago #

    no problemo on folder or file access since the blog.php is able to return data (24 KBs), but not as a valid image.

    The installation on blog.dhammacitta.org, dhammacittapress is one of the blog created in MU.

    the link is http://blog.dhammacitta.org/dhammacittapress/files/2008/08/dcpress.jpg, that url will be processed by .htaccess to redirect to blog.php to the actual path

    http://blog.dhammacitta.org/wp-content/blogs.dir/12/files/2008/08/dcpress.jpg

    no luck with .htacces mime type. Anyway the blog.php return the mime type to the user with the file size and ETAG succesfully but the actual read from file is the issue. It return a corrupted one.

  6. musnake
    Member
    Posted 15 years ago #

    I'll ask the obvious Q's seeing as I'm shooting in the dark and not being precise anyway... this condition persists regardless of image/browser/subblog? Caching?

  7. benzwu
    Member
    Posted 15 years ago #

    that's right mate. all images, all browsers, all subblogs. no caching implemented so far.

  8. andrea_r
    Moderator
    Posted 15 years ago #

    "the link is http://blog.dhammacitta.org/dhammacittapress/files/2008/08/dcpress.jpg"

    If I plunk that link in a browser, I should be able to see the image. I don't. I'll confirm it's getting corrupted.

    Did you check the original image before it was uploaded?

  9. benzwu
    Member
    Posted 15 years ago #

    Yes, i checked before upload and after. I tried to download the file again via ftp. It's OK.

  10. 1stAngel
    Member
    Posted 15 years ago #

    I am having this issue too. No images showing in my installation of MU using media or other upload programme

    Using 2.6.3

    Used Buddypress on this and avatars not showing from that. Tried to remove that but the issue remains on the base installation of MU

    Any hints as to why thios should be?

    The MU I have on the same server but different domain works fine, no problems at all.

  11. af3
    Member
    Posted 15 years ago #

    I am facing the same problem; users images are not shown in posts, pages; images in media manager are also not shown.

    I've copied blog.dir images in my local pc uzing ftp and able to view all images.

    I've also replaced the whole wp-admin and wp-includes directory with freshly downloaded latest.zip files; still no success. I'm using WPMU2.6.5. Any idea how to fix this?

  12. af3
    Member
    Posted 15 years ago #

    i just found out that i had two extra lines at the end of the php close tag in wp-config! removing these extra blank lines solved the issue of not able to show images in posts & pages -- however images in media manager and uploaded images are still not shown in the backend...

    still looking for solution.

    rgds

  13. jgulledge19
    Member
    Posted 15 years ago #

    Had the same problem on IIS 6, using Wordpress rewrite: http://www.binaryfortress.com/wordpress-url-rewrite. Images would not show and went to IIS 404 page

    Here is my hack:
    MU:

    1. Open up the file: /wp-content/blogs.php
    2. Look for $file = BLOGUPLOADDIR . str_replace( '..', '', $_GET[ 'file' ] ); - around line 68
    3. Replace it with:

      # HACK --
      // ORG - $file = BLOGUPLOADDIR . str_replace( '..', '', $_GET[ 'file' ] );
      $file_base = BLOGUPLOADDIR;
      if( isset( $_GET['file']) ){
      $file_name = str_replace( '..', '', $_GET[ 'file' ] );
      }
      else{
      $array = explode('files/',$_SERVER['REQUEST_URI']);
      $file_name = $array[(count($array) -1)];// this is the last string
      }
      $file = $file_base.$file_name;
      # End HACK

    IIS:

    1. In IIS manager right click on your website and click "Properties".
    2. Click on the tab "Custom Errors" and find 404
    3. Once you find the 404 click on it and then the Edit button.
    4. For your options select "URL" and then put in "/wp-content/blogs.php". This assumes: domain.com/wp-content/blogs.php
    5. Then click Ok, Apply, Ok

    Hope this helps someone.

  14. af3
    Member
    Posted 15 years ago #

    if this could help; try replacing yr blogs.php in wp-content folder with fresh copy from wpmu of yr version -- i did that and this no-image is fixed.

About this Topic