Winner of the Best WordPress Business Website - WP Honors 2011
Since 2004
 

Forums

 

Manuals

 

Videos

 

Live Support

 

WPMU.org

Uploaded images problem after 2.8.1 upgrade

Elite

Just upgraded to 2.8.1 on my test server, and now have an issue with images that were/are uploaded to the media library not appearing.

Prior to the upgrade, images that were uploaded to the media library (either via the admin, or the WYSIWYG tool) would be called via the path:

http://sub1.mydomain.com/files/2009/07/myimage.jpg

After the upgrade, no existing images are displaying, nor are images that I've uploaded since the upgrade.The record for the images exists, but there is no way to view the image.

It appears that after the upgrade the path being used by WPMU is no longer pointing to the actual location of the files which appears to be in wp-content/blogs.dir/1/files (or /2/files, /3/files, etc.)

Any thoughts or tips?

Everyday at WPMU DEV we help hundreds of WP Users. Become a member today to:

  • Download 250+ Premium Plugins and Themes
  • Get unlimited support from WordPress Experts
  • Get help with your WordPress or BuddyPress projects

Help & Support from WPMU DEV members and staff

Staff

Sounds a little odd - there are some bugs with 2.8.1 but I didn't know that this was one.

Keeper of the Dark Chocolate

A link to an example Page or Post where the missing images can be seen would be a plus.

We're not seeing it. SVN'ed out 1883 this morning from 187-something. Haven't heard anything.

Get personal, comprehensive and timely support and assistance
from WordPress Experts

Elite

Another post (blogs.dir images not appearing and article links 404) seems to address a similar problem, so I checked my .htaccess file, which seems fine - didn't change since upgrading to 2.8.1.

As mentioned before, images that are uploaded are landing in the correct directories (wp-content/blogs.dir/1/files,/2/files, /3/files, etc.) but when the system tries to call them via the path sub1.mydomain.com/files/2009/07/myimage.jpg - nothing.

The htaccess file does contain the following line, which seems to deal with paths for uploaded images:

<br />
RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]<br />

I don't know enough about how the htaccess file works with WPMU to determine if there is a change needed here, but it appears it might be a place to start.

Attached is a screenshot from the Media Library admin panel that shows how images are just not displaying.

When I view source, the code shows that it is rendering the IMG tag...

<table class="slidetoggle describe form-table"><br />
		<thead class="media-item-info"></p>
<p>		<tr><br />
			<td class="A1B1" rowspan="4"><img class="thumbnail" src="http://test.airfoil.net/files/2009/05/testimage.jpg" alt=""></td><br />
			<td>testimage.jpg</td><br />
		</tr><br />
		<tr><td>image/jpeg</td></tr><br />
		<tr><td>2009-06-08 10:14:57</td></tr><br />
		<tr><td></td></tr></p>
<p>		</thead>

...but the image doesn't display. If I type the path directly into a browser, I get a 404.

So, it seems that WPMU is no longer translating "http://test.airfoil.net/files/" to the directory "blogs.dir/1/files" - resulting in it not finding the image.

[attachments are only viewable by logged in members]

Erstwhile founder

Hiya,

If I type the path directly into a browser, I get a 404.

That means the .htaccess file isn't doing it's job for some reason. Ask your host to take a look. Maybe they can spot the problem.

Thanks,
Andrew

Inactive

@airfoil ...If I may ask, did you resolve this problem? I'm having the same problem, except intsead of a 404, I just get an empty image placeholder in IE. Thanks

Inactive

Hi,

THere is a solution for this?, I´m having the same problem :(

Get personal, comprehensive and timely support and assistance
from WordPress Experts

Erstwhile founder

Hiya,

Make sure your .htaccess file is intact. Also check the permissions on blogs.dir.

Thanks,
Andrew

Inactive

Hi Andrew,

My .httaccess file have this:


RewriteEngine On
RewriteBase BASE/

#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]

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

I haven´t changed since the instalation. and the blogs.dir have 777.

BTW. This happend when I choose a new permalink structure.
/%year%/%monthnum%/%postname%/
Also checking the blog configuration I see this:
Upload file: files
Fileupload URL: http://blogs.mydomain.com/files

Any idea!? :(

Thanx.

Erstwhile founder

Hiya,

You need to change this line:

RewriteBase BASE/

To this:

RewriteBase /

Thanks,
Andrew

Inactive

I am having the same issue - I checked my .htaccess file and it appears to be exactly as the one aboe and it did not have BASE.

I am in a 2.9.2 MU install using the WPMU BP Daily Buddy Press theme.

files are there, even are blocked out in post - but if you click the image you get a 404...

Get personal, comprehensive and timely support and assistance
from WordPress Experts

Inactive

to follow up - I had to do a complete re-install and new DB creation - all images show now

EXCEPT only to logged in users - hmmmmm

Erstwhile founder

Can we please get a link to your site and a link to an image that should be working but isn't?

Thanks,
Andrew

Get personal, comprehensive and timely support and assistance
from WordPress Experts

Inactive

Hey,

Im also getting the same problem (Images I upload via the media library in WPMU (2.9.2 with buddypress) are only visible when users are logged in)

Here is a link to a post with an image on it:
http://www2.gamesphere.com.br/2010/07/23/novos-ladders-fifa10-pc-xbox360-ps3/

When logged in the image src is: http://www2.gamesphere.com.br/files/2010/07/fifa10-150x150.jpg
When not logged in src is: http://www2.gamesphere.com.br/4/2010/07/fifa10-150x150.jpg

The relative info in my .htaccess looks like this:
`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]
RewriteRule ^(.*/)?avatar/(.*) wp-content/avatar.php?file=$2 [L]
RewriteRule ^(.*/)?sitemap.xml wp-content/sitemap.php [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]`

My WPMU is installed in a subfolder (public_html/v5/wp/)

I read other topics on this issue but dont know how to fix it:
http://core.trac.wordpress.org/ticket/12044
http://mu.wordpress.org/forums/topic/16694

Everything else works fine.
Any tips on how to fix this would be great, thanks.

Staff

That's quite a pain huh! Sorry to hear it.

Have you considered an upgrade? Or is that not an option.

Inactive

Has anyone ever figured this problem out? If you check the wordpress.org forum, you can see dozens of people are now having this issue with images on both upgrades and fresh installs of 3.0 and 3.0.1.

Staff

I'm pretty sure it was worked out - 9/10 it's a server issue and the user didn't come back.

Get personal, comprehensive and timely support and assistance
from WordPress Experts

Keeper of the Dark Chocolate

Well in Johny's case, the issue is probably because wpmu is installed in a subdirectory. Lost count how many times we told people in the wpmu forums that they would have problems if they did that. It needs to be in root. That would be my guess.

Elite

Here it is, a year later, and several versions up and I am having this problem with images.
Network: WP 3.3.1 Multisite, BP 1.5.3.1,
This is functioning as two networks, although I had tried two plugins to accomplish Multi-networks, both of which had problems and so I deactivated: Networks for Wordpress and WP Multi Network. Realizing Multi-networking was functioning even so doesn't make sense. But maybe this relates to the problem.

Problem one:
Network 2 Site 1: Contact form 7, Cubepoints, Cubepoints Buddypress Integration Marketpress 2.4.2, Membership Premium 2.1.4
Network 1 Site 1: No plugins active

On site 2: I upload an image. I do not see it in the dialog box, and do see a broken link in the page. In /media library/ I see the item record but the image is not visible. I click on 'edit', then again on 'edit image' and I DO SEE the image.
File url: http://chamberofcommons.com/wp-content/blogs.dir/2/files/2012/01/logo2501.jpg leads to 'page not found'

On site 1: image upload successfully
File url: http://econethub.com/wp-content/uploads/2012/01/collage.jpg

Replacing segments of the site 2 URL to match the site 1 URL:
http://chamberofcommons.com/wp-content/uploads/2012/01/logo2501.jpg STILL yields 'page not found'

Problem 2 (maybe relates to Prob 1:
Add a 2nd site under Network 2 as a subdomain. Exists in admin, but on site visit: "server not found"

We can help you out. Become a member today to:

  • Let our team help you out today and access to over 250+ Premium Plugins and Themes
  • Find out why people saying "it's like having your own developer"
  • WPMU DEV - The WordPress Experts