I saw a couple of post similar to this. The solution there looks pretty much simple but none worked for me. Disabling ImageMagick, uninstall and re-installing all related modules (Image Field, File Field, ImageAPI, ImageMagick, ImageCache and recreated my node type and field where it was associated with. None of these worked.

Reproduce: Create a content type with image field. Create content. Then add a node view. Add content-image-field we added in that content type in step 1. Neither on preview nor the actual view the image displays. Anybody can reproduce?

Comments

halloffame’s picture

Title: Image Field Doest Not Render in Views » Image Field Does Not Render in Views
halloffame’s picture

Priority: Critical » Normal

It appears that all the images uploaded in my sites/default/files folder are not accessible/displaying through Views or any theme templates for that matter. However, if I move the images outside 'files' folder the images are just working fine.

I discovered this as I'm trying to display the image using other method since I can't display it through Views. Looks like its still the same.

Can anybody please help me figure out what's going on?

quicksketch’s picture

Category: bug » support

So you can't access the images at all when they're inside the files directory (just by typing in the URL directly)? My guess is that it's a server configuration problem, mostly likely caused by the hidden ".htaccess" file that Drupal puts in place in the root of the files directory. Just for a test, try putting the image back into the files directory, delete the ".htaccess" file from the root of the files directory (but not the root of your Drupal site!), then try to hit the image URL directly again.

halloffame’s picture

I can access the files alright directly through the URL. I should have pointed this out. I also should have pointed out that I can access the user avatar (through Views) located in the same folder.

I don't know if my problem number 1 has something to do with my problem number 2.

I have a rotate.php script to display dynamic images from the same fields I'm trying to do with Views. This script along with all the other images I want to rotate is in sites/default/files/imagefield_thumbs/ (the same images I want to call from Views). I tried moving the 'imagefield_thumbs' folder where the images and script are located up a notch to 'default' -- wow it worked! So I tried in other folders. It all did worked perfectly! When I moved the imagefield_thumbs in to numerous other locations the script seems to work fine but never in 'sites/default/files'. However, I can print a static image directly into the template from the sites/default/files/imagefield_thumbs/ folder.

But I wouldn't have to do that if Views only displays image_field properly with no problem. Can you reproduce my problem in post number 1?

quicksketch’s picture

I'd check what your file directory is set to at "admin/settings/file-system". It is very odd that files would work at "sites/default" instead of "sites/default/files".

halloffame’s picture

It is indeed sites/default/files... Waaa! Whats going on here...

halloffame’s picture

Status: Active » Fixed

Found the culprit. Wheww! There's a Drupal generated .htaccess in the files folder. I deleted that and voila! Both of my problems solved! Image Field in Views is now working as well as my rotate script.

.htaccess has the following:
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
Options None
Options +FollowSymLinks

It says 'Do not remove'.... But I have to...

halloffame’s picture

Ughh! The htaccess file is persistent. It keeps on coming back even after I delete it.

quicksketch’s picture

You might read #431310-11: Server 500 Error prevents images from displaying in which I've explained the .htaccess file before. Commenting out all these lines is *highly* dangerous if you're on an Apache server, exploitable if anyone on the site is able to upload files.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.