Trouble viewing images in DirectAdmin

pbooks

New member
Joined
Aug 17, 2006
Messages
4
Hi,

Please forgive me if I have wandered into the wrong part of the forum. If you could point me in the right direction, that would be great.

I have an odd problem with viewing my images in the "Image" files I set up in my DirectAdmin public html pages. I can view them when I use the url (minus all the admin stuff i.e. www.pattysbooks.com/_.jpg vs http://www.pattysbooks.com:2222/CMD_FILE_MANAGER/
etc.) directly in the browser window. But when I try to view them by clicking on the image name in my admin files, (which brings up the url with all the admin stuff) I get several pages of gibberish and characters that mean nothing to me instead of the image itself.

Since many of my images are named by the ISBN of the books they represent, I have no easy way to clear out my files when I no longer need the images.

This could be be a coincidence, but I have noticed that when the file extension is in lower case letters I can view them (i.e. jpg or gif). But when they are capitalized (JPG or GIF), then I get the gibberish instead of the image itself. Since capitals are the default that my image program uses when naming images for uploading, I'm not sure how to work around the problem. (If this is even the problem.) The image program doesn't offer another option for naming images.

Hundreds, if not thousands, of these images are in use so renaming them is not an option at this point.

Any advice would be appreciated since my image files are overflowing and I would love to be able to clear out the dead wood.

Sincerely,

Patty
 
Hello,

Sounds to me like a mime.type issue.

Check your /etc/mime.types file. In it, there should several hundred lines for all of the file types and what they're supposed to do. The jpg line should look like:
Code:
image/jpeg                      jpeg jpg jpe
If you dont have it, you can add it. That way, the correct httpd headers will be included when DA sends your browser the image. You're downloading the exact same files, but the browser just down't know what to do with the image if the type isn't specified in the httpd headers. DA uses the /etc/mime.types file to figure out what type to include in the header.

John
 
Okay, I'm going to show my ignorance. :o)

The jpg line should look like:

code:image/jpeg jpeg jpg jpe

That is what it looks like. Do I need to tell it to also read the extensions in capital letters or is it not case sensitive? If I do need to tell it to read caps, how would I do that?

Sorry for the silly questions!

Thanks,

Patty
 
Hi John,

I'm not sure I understand your response.

all lower case.

It will only read lower case?

It is or is not case sensitive?

In other words, am I out of luck that a few thousand of my images have the file extension in caps? Since they are in use, I would have to revise all of them not just in my DA, but also on the sites where they're being used. Just so I can see them to delete the ones that I no longer need.

Is that correct?

All future file extensions need to be in lower case?

Don't mean to be dense, but this looks like a ton of work for such a simple thing. I wish I had known from the start that only lower case file extensions could be used.

Thanks for the help, even if it was bad news.

Patty
 
Sorry, I'll try and be a bit more descriptive in my response ;)

I'm fairly just that apache converts all of your file extensions to lower case before it does the header lookup, so you can just use the listed entry, above. That the same entry we have on our servers. But in general, I like to keep things lower case anyway, for consistency, but upper case should work just fine. It's possible that DA does not do this conversion to lower case, which might explain the problems ... try adding JPG (or Jpg, or whatever you've got) into the /etc/mime.types file to see if that fixes it up for you.

Upper case extensions should be fine.. let me know if adding them to the mime.types file works and I'll get DA to swap the case to lower when doing the lookup, just as apache does.

John
 
Hi John,

Not sure where to find

/etc/mime.types file

I went in and created two User Installed MimeTypes -

image/jpeg JPG

and

image/gif GIF

Is that what you meant? I didn't see where I could edit the system mime files.

If I did it correctly, it made no difference.

Okay, I just tried an experiment. My default browser is Firefox (I hate using IE and will only do so under duress.) But I viewed the following url in IE and it worked!

http://www.pattysbooks.com:2222/CMD...com/public_html/Images/ebay/ 0394500806-1.JPG

The same url will only bring up gibberish in Firefox.

At least I have a way to view the images to clear out my files. Even if it does mean having to use the dreaded IE.

Thanks again, John, for all your help. I really appreciate you taking so much time with a total non techie.

Patty
 
Back
Top