Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / General Questions / some images not displaying because they're JPG instead of jpg

some images not displaying because they're JPG instead of jpg

Locked
This thread is locked. New replies are disabled.
15 Nov 2010, 9:15 AM
#1
nathanscrivener avatar

nathanscrivener

New Zenner

Join Date:
Oct 2009
Posts:
36
Plugin Contributions:
0

Post #1 by nathanscrivener

Hi, this is a second issue I am having with my migration to a new server.

A whole bunch of jpg images on our site have a capitalised file extension .JPG instead of .jpg. This never posed a problem for us on Bluehost, but on the new server and on our local machine these images do not display.

I can correct one by one by changing the database file reference and then manually changing the file name to lower case, but that would take forever!

Would anybody be able to shed some light on this?

Thanks :-)

15 Nov 2010, 1:29 PM
#2
muzz avatar

muzz

Totally Zenned

Join Date:
Mar 2009
Location:
Australia
Posts:
604
Plugin Contributions:
0

Post #2 by muzz

I can't name other software in here but i suggest you do a search in google for these keywords.

rename file extensions bulk

That wasn't the plan!

15 Nov 2010, 2:18 PM
#3
batman42ca avatar

batman42ca

New Zenner

Join Date:
May 2010
Posts:
32
Plugin Contributions:
0

Post #3 by batman42ca

This sounds like a windows vs unix issue. To the filesystem on Windows, upper case and lower case names are identical. Not so on Unix.

What I would do, because I'm developing on a Windows system, is simply type this at a command prompt in the directory where the images are found:

rename *.JPG *.jpg

Assuming the database records contain lowercase .jpg

15 Nov 2010, 5:44 PM
#4
nathanscrivener avatar

nathanscrivener

New Zenner

Join Date:
Oct 2009
Posts:
36
Plugin Contributions:
0

Post #4 by nathanscrivener

I don't use Windows. Home computer is Ubuntu 10.04. Old server is Bluehost running CentOS (5.2 I think). New server is running 10.04.

Everything works on Bluehost. But doesn't on my Ubuntu boxes.

There is no mis-match between the file names and their associated references in the DB.

But I have to change the DB reference to have lower case .jpg and then also change the actual file name itself.

:dontgetit

15 Nov 2010, 5:49 PM
#5
nathanscrivener avatar

nathanscrivener

New Zenner

Join Date:
Oct 2009
Posts:
36
Plugin Contributions:
0

Post #5 by nathanscrivener

Further, I have discovered that browsing directly to those images presents a 403 forbidden error. Changing them to lower case .jpg on the extension allows the image to be viewed.

So there must be a setting in Apache somewhere? One that is set on Bluehost but not on my Ubuntu boxes.

Any ideas?

18 Nov 2010, 10:01 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #6 by drbyte

What version of Zen Cart?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

18 Nov 2010, 10:04 PM
#7
nathanscrivener avatar

nathanscrivener

New Zenner

Join Date:
Oct 2009
Posts:
36
Plugin Contributions:
0

Post #7 by nathanscrivener

My apologies, I resolved this with somebody on the Ubuntu forums. It was an htaccess directive only allowing certain file types - supposedly for security.

I amended this and it fixed the problem.

Thanks
Nathan

18 Nov 2010, 11:44 PM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #8 by drbyte

The latest version of Zen Cart includes .jpg and .JPG allowance in its .htaccess files.
If you went and removed the restrictions, then you've removed security protections which are intended to safeguard you from hackers abusing your site for phishing activities.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.