Uploaded images problem after 2.8.1 upgrade
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?
Help & Support from WPMU Dev members and staff
Sounds a little odd - there are some bugs with 2.8.1 but I didn't know that this was one.
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.
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]
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
@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
Hi,
THere is a solution for this?, I´m having the same problem :(
Hiya,
Make sure your .htaccess file is intact. Also check the permissions on blogs.dir.
Thanks,
Andrew
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.
Hiya,
You need to change this line:
RewriteBase BASE/
To this:
RewriteBase /
Thanks,
Andrew
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...
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
Can we please get a link to your site and a link to an image that should be working but isn't?
Thanks,
Andrew
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.
That's quite a pain huh! Sorry to hear it.
Have you considered an upgrade? Or is that not an option.
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.
I'm pretty sure it was worked out - 9/10 it's a server issue and the user didn't come back.
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.