nbostic
Expert
Just Getting Started
Member Likes (0)
I've looked through the forums here and over at WPMU and none of the suggestions are working. When I try to upload an image, the image is uploaded to an ftp directory of /wp-content/blogs.dir/12/files/2009/03/ and thumbnails are created. But the image can't be viewed in a post or in the media library. The flash uploader always gives an http error after crunching. Browsing to addresses such as sub.domain.tld/files/2009/03/filename.jpg gives a 404 error. Permissions for blogs.dir and all subs are 775. I'm completely lost and the suggestions I've found so far just aren't helping. The only modification I've made the the htaccess file is for the supporter/plugins plugin. Thanks in advance.

Responses (30)
Keeper of the Dark Chocolate (joined July 2007) Likes (0)
What;s the specific http error you are receiving after crunching?
Also can you give the specific file name and size of the uploaded file?
Can you please provide a link to a specific post where a broken image is so we can see what's occurring?
Member (joined February 2009) Likes (0)
Without changing a thing, now the flash uploader is not giving an http error, so I guess we can scratch that off the list.
The file name is testimage.jpg and it is 99kb.
And finally, here's a link to a test post:
http://nbostic10.oregonrealestateblogs.com/2009/test-post-upload/
Thanks again for the help.
Keeper of the Dark Chocolate (joined July 2007) Likes (0)
That looks fine. Just so you know, try to keep away from file names with spaces and non standard characters (ie $%^&) as those get translated into web safe characters and wp sometimes doesn;t handle them too well. You'll get 404s and the like.
And a bit of fooling around with the url of the image doesn't pull anything up, except for the 404 within the blog. No additional weird directories or trailing slashes or whatnot.
And you've confirmed that the images are there and available.
Hmmm....
What;s the ownership of the created directories and of the images?
Can you post your htaccess please?
(joined July 2007) Likes (0)
what *was* the http error you were getting?
And have you checked your error logs?
Member (joined February 2009) Likes (0)
All folders are 775 and the files themselves are 664. Here's my 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]
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]
<IfModule mod_security.c>
<Files async-upload.php>
SecFilterEngine Off
SecFilterScanPOST Off
</Files>
</IfModule>
Sorry, I don't remember the specific error message. As for the error log, only some plugin errors for plugins that have since been deleted.
Erstwhile founder (joined May 2007) Likes (0)
Hiya,
The error message would be very helpful. Could you try to upload an image and copy/paste the error?
Thanks,
Andrew
Keeper of the Dark Chocolate (joined July 2007) Likes (0)
Had one of my clients get the "http error" last night. Turned out the file being uploaded was bigger than what was allowed. Check your php.ini for max_file_upload_size or something like that. (I know it;s max_file_something)
Strange though that it's only 99kB though. Still something to check.
Member (joined February 2009) Likes (0)
The http upload error isn't there anymore. It hasn't been since my second message up at the top. So I don't need to troubleshoot the http/flash upload error. I still need to figure out why the uploaded images aren't displaying though.
Member (joined May 2009) Likes (0)
I got the same issue. The files upload to the blogs.dir/1/files/2009/06/sanchezgq.jpg but I get the broken link question mark icon when i try to view them anywhere.
When I 'view on the web' through fireftp i get:
The requested URL /public_html/wp-content/blogs.dir/1/files/2009/06/sanchezgq2.jpg was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
I've read through WPMU forums with no luck. Kind of like this thread they just stop with no conclusion. Error logs are clean, contacted pSek re: whether PHP is running in CGI or Apache mode (they said cgi mode) , my blog.dir and subfolders permissions are set to 777 (probably shouldn't be right?). Don't know if it's related but I couldn't get avatars to show up either at first (they weren't broken links, they just didn't display for some reason). But know the one for my admin acct does display. I am running BuddyPress and am on a hosted account until temporarily.
.htsaccess file looks like this
RewriteEngine On
RewriteBase /
AddHandler application/x-httpd-php5 .php
#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]
<IfModule mod_security.c>
<Files async-upload.php>
SecFilterEngine Off
SecFilterScanPOST Off
</Files>
</IfModule>
I really have tried for hours looking for the answer for myself before submitting here. Please advise. Thanks
Keeper of the Dark Chocolate (joined July 2007) Likes (0)
Link please to an example of a missing image.
You do see the file names being different, right?
edit: It looks like you;re actually having a different problem because you;re not reporting an issue of cruching as note up above. Or are you?
Member (joined May 2009) Likes (0)
thanks doc,
1. here's the link you asked for:
http://thesportsfag.sportsfags.com/2009/06/13/hey-espn-favrewatch-sucks/
2. not sure what you mean by seeing the file names being different.
3. I thought the issue reported above started off the same as mine and then went into separate issue with the flash uploader cause later down in the post it seemed like that issue was resolved but the original issue (like mine) wasn't. His last post was:
That's still the issue I'm having (images aren't displaying), but if I need to start a new post I can. Just let me know. Sorry I thought it was ok just to check for an update here to what seemed like an identical issue. I'm new to this forum so if that's wrong let me know.
Keeper of the Dark Chocolate (joined July 2007) Likes (0)
On ipod. Excuse shortness. You're looking at sanchezgq.jpg in one example and sanchezgq2.jpg in second. (Damn, that was a bitch to remember) Two different file names.
On side of road walking to brueggers. Look later if I can get a terminal at th elibrary.
Member (joined May 2009) Likes (0)
No worries. I hope you got there OK. The image not displaying happens with every image uploaded. Yes, those are two separate example but alas the same issue. Any suggestions?
Keeper of the Dark Chocolate (joined July 2007) Likes (0)
F'ing library. Thinks it's a sex/ porn site.
A couple things I just noticed on your post here.
- You state that it;s a .htsaccess file. The correct file name should be .htaccess Could you please check on that?
What's with all of the spaces between lines? You haven't edited this file in anything like Word or Wordpad, have you? No garbage copied over but I know if the file isn't ansi, it won't be read by the webserver.
It's strange that the direct url for the image doesn't work either:
http://thesportsfag.sportsfags.com/wp-content/blogs.dir/1/files/2009/06/sanchezgq2.jpg
Ditto on trying it through the first blog:
http://sportsfags.com/wp-content/blogs.dir/1/files/2009/06/sanchezgq2.jpg
Can you go down the list of directories there and see what got created? (ie blogs.dir, 1, files, etc.)
Can you also make sure that blogs.dir is either 777'ed or owned by the webserver's user (usually nobody or apache)
Member (joined May 2009) Likes (0)
Doc,
1. .htaccess file name was just a typo in my post here.
2. re: the lines in the file not sure but i copied it from view mode in fetch so that might be the reason why there are lines. the only editor i have used is smultron and it was just to add a line for a plugin.
3. i have two blogs set up #1 and #21 in blogs.dir. Here's what got created in both:
blogs.dir/1/files/2009/05 is blank
blogs.dir/1/files/2009/06 has sanchezgq2.jpg only
blogs.dir/1/files/2009/avatars/0 has three files cause i couldn't get it to work. they are image_1070.jpg, image_10701.jpg and thesportsfag1.jpg
blogs.dir/1/files/2009/avatars/1 two files thesportsfag1-avatar1.jpg and thesportsfag1-avatar2.jpg
blogs.dir/21/files/2009/06 has sanchezgq.jpg, sanchezgq1.jpg, sanchezgq2.jpg, sanchezgq-150X150.jpg, sanchezgq-300X300.jpg, sanchezgq1-150X150.jpg, sanchezgq1-300X300.jpg
that's it
4. yes, blogs.dir is set to 777 not sure about the other owners.
thanks for your help.
Member (joined May 2009) Likes (0)
Anyone got an idea??? It seems like this issue started by nbostic is the same issue I got, but threads with this issue seem to just die without any resolution.
Any help would be greatly appreciated.
There was a suggestion from three years ago over on WPMU forums to update .htsaccess as follows:
Find:
RewriteRule ^([_0-9a-zA-Z-]+)/files/(.*) /wp-inst/wp-content/blogs/$1/files/$2 [L]
RewriteRule ^([_0-9a-zA-Z-]+)/wp-content/blogs/(.*)/files/(.*) /wp-inst/wp-content/blogs/$1/files/$3 [L]
Replace with:
RewriteRule ^([_0-9a-zA-Z-]*)/?files/(.*) /wp-inst/wp-content/blogs/$1/files/$2 [L]
RewriteRule ^([_0-9a-zA-Z-]*)/?wp-content/blogs/(.*)/files/(.*) /wp-inst/wp-content/blogs/$1/files/$3 [L]
This post was from like three years ago and I thought that maybe this would have been resolved by now so I'm kind of sketchy about fooling around with .htsaccess if I don't have to. Ideas anyone?
Thanks
Erstwhile founder (joined May 2007) Likes (0)
Hiya,
I wonder if it's a PHP5 issue. Try removing this line from your .htaccess file:
AddHandler application/x-httpd-php5 .php
Thanks,
Andrew
Member (joined September 2008) Likes (0)
Same issue here - server using suphp, folders all 777 and correct owner and groups, wp 2.7.1
You can access this: http://test.yourwizardhosting.com/wp-content/blogs.dir/33/
But try to open the files folder and you get a 404. I have a support ticket in to the host to see if they can do anything, but open to suggestions till then. :)
.htaccess file:
RewriteEngine On
RewriteBase /
#uploaded files
RewriteRule ^(.*/)?files/$ index.php [L]
RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]
RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
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]
RewriteRule ^(.*/)?avatar/(.*) wp-content/avatar.php?file=$2 [L]
<IfModule mod_security.c>
<Files async-upload.php>
SecFilterEngine Off
SecFilterScanPOST Off
</Files>
</IfModule>
Member (joined September 2008) Likes (0)
My issue is definitely linked to the .htaccess file - if I delete it I can access the folders fine - any one handy with the rewrite rules? :)
Member (joined September 2008) Likes (0)
I fixed my issue by updating the permission on blogs.php (which one of the rewrite rules were pointing to) to 755, not sure if that got changed during my move to suphp or it wasn't needed before but it's all working again!
Erstwhile founder (joined May 2007) Likes (0)
That's interesting. Can anyone else confirm that fix?
Thanks,
Andrew
Member (joined October 2007) Likes (0)
that sounds like usual behaviour to me.
when installing wpmu or wp on a host using suPhp first I tried 0775 as permissions, but my host would only show me a warning to set the permissions to 0755 :-) so it seemed natural from then on to automatically set those permissions...
Member (joined May 2009) Likes (0)
Andrew,
I had another issue that I resolved and when I did presto the images are no longer broken!!! For some reason my BuddyPress tables were not created when I installed BuddyPress. I followed the instructions in the thread below and my problems were solved last night. Thanks for the ideas and suggestions.
http://buddypress.org/forums/topic.php?id=1096#post-5101
Keeper of the Dark Chocolate (joined July 2007) Likes (0)
Just for reference, we should not be able to see that directory. You should be getting a 404 for the test blog. No directory should be displayed under the blogs.dir subdirectory.
mahodder, can you check to see if the change to Apache have been made:
http://trac.mu.wordpress.org/browser/trunk/README.txt#L37
Member (joined June 2009) Likes (0)
I have a similar problem.
I have uploaded the jpg file with a form created by cFormsII
I can see it at
http://parkerwhitepruitt.com/tributes/wp-content/blogs.dir/1/files/2009/06/noid-P6185248-500.jpg in the browzer
I cannot see or assign it in the Media Library
The owner is apache
Permissions are 755
I see that the other files have two other files created in different resolutions.
Can this be the problem? Is there a way to force the media library to rescan and create the proper files?
thanks
wjwjr
Erstwhile founder (joined May 2007) Likes (0)
Hiya,
Unless the necessary db entries are added files won't show up in the media library. The media library doesn't just scan the files directory for files I'm afraid.
My guess is that the forms plugin isn't adding the necessary db entries. That's just a guess though.
Thanks,
Andrew
Member (joined June 2009) Likes (0)
Andrew, thanks for the reply
It seems that when i add a jpg thru media manager
jquery inserts into
wp_1_posts with a guid value= (something that isnt exactly the path to the file)
and a record in wp_1_meta that has
post_id=wp_1_posts.id and
meta value = (a part of the correct path) and
meta_key=_wp_attached_file
The only options i see are 1. edit the plugin to insert the correct records or
2. look for a plugin that does what i and looking for (the ability to allow subcribers to upload a jpg for approval and posting by the admin or an editor, that works with the media library...
Does anyone know of such a plugin?
thanks
wjwjr
Erstwhile founder (joined May 2007) Likes (0)
Have you contacted the developer of the plugin your using? They may be willing to update the plugin to work with the media library.
Thanks,
Andrew
Member (joined June 2009) Likes (0)
not sure if it ever will just by cforms placing it in the right directory. afaik the media gallery is driven by Wordpress and it requires to use its own upload mechanism to catalogue an image, perhaps I'm mistaken.
from
http://www.deliciousdays.com/cforms-forum/troubleshooting/image-help-please/?value=gallery%251&search=1&ret=all
It seems that this is a known issue...but will ask any way
Thanks again for the quick reply
wjwjr
Member (joined June 2009) Likes (0)
I found a plugin that will make the correct entries into the tables
Add From Server
It seems to work ok with mu
wjwjr
Become a member