The MU forums have moved to

No image on webpage after successful upload (10 posts)

  1. netwit
    Posted 14 years ago #

    Hi all,

    I'm new to WP MU but really like what I see!!
    I have what appears to be an age old issue with uploads.
    I have looked over previous posts, but none seem to finalized in a way that helps me :-(

    I'm adding an image using the "Add an image" link in the EDit Post form.
    Upload is successful, anbd The link URL is shown as follows:
    <img src="" alt="swimming2" width="150" height="150" class="alignright size-thumbnail wp-image-37" />
    The image does not show up on a web page, although space is allowed for it.

    If I change the URL to:

    it shows up. Also, just typing that in a browser window also makes it show up.
    Thus this part is not in the sytem generated URL:


    I don't much mind fixing it manually for the main blog, but what if I hand admin to someone else? Also it's a school site with the intention of staff and learners operating their own blogs.

    This is the relative portion from the .htaccess file:
    RewriteEngine On
    RewriteBase /blog/

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

    Active plugins:
    TypePad Antispam
    WordPress Hashcash


    Any ideas welcome, please

    PS I changed the pic so thast it is a decent size to start with - URL's updated above.

  2. netwit
    Posted 14 years ago #

    I created a test blog in a subdir. An uploaded image appears on it's webpage. Now I'm confused - any thoughts?

  3. kgraeme
    Posted 14 years ago #

    Did you convert a standalone WP install to a MU install?

    If you go to the problem site's edit page (Dashboard > Site Admin > Blogs > Edit, the file upload path is listed there.

  4. inweb
    Posted 14 years ago #

    I am having the same problem, and am wondering if anyone has found a fix...

    Image upload error:

    Uploading crunches just fine.
    Image is placed in blog post, but shows as broken link.
    When checking the actual url I get a 404 error.
    I can see the uploaded images in filezilla at: /public_html/wp-content/blogs.dir/56/files/2009/10/image1.png

    can see three versions of the same image - 3 dif sizes.

    File upload URL: http:// quiltersbarn.allthingsquilting (.)

    Upload Path: wp-content/blogs.dir/56/files

    Attempts to fix Include:

    Changed file attributes of blogs.dir to 777 as suggested on wpmu premium forum
    **results still the same

    Changed blog.php to 755 as suggested on wpmu premium forum
    **results still the same

    changed Site Admin/Options to:
    Blog upload space: 4024 MB
    Maximum file upload: 3000 KB
    ** results still the same

    htaccess : RewriteEngine On
    RewriteBase /

    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?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]
    RewriteRule ^(.*/)?sitemap.xml wp-content/sitemap.php [L]
    RewriteRule ^(.*/)?global-posts-feed/(.*) wp-content/recent-global-posts-feed.php [L]
    RewriteRule ^(.*/)?avatar/(.*) wp-content/avatar.php?file=$2 [L]

    <IfModule mod_security.c>
    <Files async-upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off


  5. andrea_r
    Posted 14 years ago #

    If it uploads the pics fine, but doesn't rewrite the URL properly, changing folder permissions won't do anything.

    I'd temporarily try a default htacess, because you've got extra rewrite rules in there, and see if that works.

    Do images show on the main blog fine? (when you upload them, that is)

  6. gazouteast
    Posted 14 years ago #

    Hi andrea - sorry if it appears I'm stalking on this issue - but I have exactly the same issue and I have the default .htaccess

    I keep coming back to this bit of the default htaccess --
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]

    I have no idea why but I just keep getting the feeling there's something missing from the first and/or third line of that snippet - admittedly I haven't a clue about how to code rewrite rules, but it just keeps making me feel that something's missing.

    It's almost like it should have something along the lines of (in my rough logic-speak) --
    RewriteRule wp-content/blogs.dir/blog_ID/files/ subdomain_name
    (I know that's completely wrong code, but it's something like that that I'm expecting to see in that part of the htaccess)

    This topic is turning me into a stalker - someone fix it fast, please



  7. andrea_r
    Posted 14 years ago #

    I don't know. I have the exact same and it works for me.

  8. gazouteast
    Posted 14 years ago #

    Here you go Andrea - all laid out nice and neat so you can see it in action

    Have a nosy and let me know what you think

    This is a brand spanking new fully clean install with zero plugins or customisation (except the date format - I'm a Brit not a Yank) and pretty URL change to only Year and Month (no need for the day too).

    ... and this is now into double digits in terms of how many times I've wiped this install and started again.


  9. Person
    Posted 14 years ago #

    If it were an .htaccess issue, then the original URL should still work while the rewritten URL won't. In your case, neither appear to work, and it looks like your setup is blocking the readfile() PHP function. You should ask your server administrator about it.

  10. gazouteast
    Posted 14 years ago #

    Thanks person - your reply absolutely put me on the right track - as soon as I contacted my host's support - they fixed it in seconds and the problem went away

    Star response from you - wish they had that info in the readme file though

    Many thanks again

    p.s. - another thread with same topic -

About this Topic

  • Started 14 years ago by netwit
  • Latest reply from gazouteast