I'm trying to allow members to upload a picture to the my website. I In my php code I test the uploaded files for type. For some files it works fine, but I've discovered there are .jpg files that don't seem to have the internal type headers and the php $_FILES array will not have any data in the type variable.

if (($_FILES["$Flnm"]["type"] == "image/gif")
  || ($_FILES["$Flnm"]["type"] == "image/jpg")
  || ($_FILES["$Flnm"]["type"] == "image/png")
  || ($_FILES["$Flnm"]["type"] == "image/jpeg")
  || ($_FILES["$Flnm"]["type"] == "image/pjpeg"))

This is the 'if' test for type, but on some files this variable is blank.
The thing is the files that return a type blank are first download from my Kodak digital camera. However I know that these files are accepted on other web site like Craig's List. So I think there must be a work around.

So you need to process them a different way. Or decide if you want to accept the file or not. The whole point of checking the file type is to make sure you are getting a specific type of file. So if the image type comes across as blank, save it in a 'safe' folder and perhaps send an email to somebody to verify the image is an image before moving the file into the users account or whatever you are doing.
Or even easier, tell the end user that the file they are trying to upload does not have an image type associated with it. use a photo editor to convert/save the image as a jpg and re-upload. gimp is a free editor. There may be some online tools to convert photos as well.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.