Jump to content

Force Apached to treat .JPG the same as .jpg


justinbeeler

Recommended Posts

Hello, I posted this issue in php coding board, but I think this really is an Apache issue. 

 

Here is my issue:

I have created a social poker site and there is a PHP script that makes thumbnails from the members' photo.  It does fine for all image types .jpg, .jpeg, .png and .gif.  However, if a file has been uploaded with the extension .JPG, it does not show up.  I was under the impression that regardless of the jpg extension the MIME type should be the same.  I went through and changed all of the .JPG extensions to .jpg but the photos still aren't displaying.

 

I read somewhere that Apache is case-sensitive in treating filenames and extensions.  I'm a designer and amateur developer, but don't have much knowledge about Apache other than running MAMP and doing some minor .htaccess stuff.  Does anyone know how to do this?  I think I read something about mod rewrite?  Any help would be greatly appreciated!

I read somewhere that Apache is case-sensitive in treating filenames and extensions.

 

What if someone uploaded image.EXE? Then we'd be messed.

 

Using something such as stristr or strtolower on the extension is good practise, as regardless of case that is all you're needing to work with, the letters not the case.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.