The php in the script which I am creating :
[php]
$uploadedfile = $_FILES[‘file’][‘tmp_name’];
$filename = stripslashes($_FILES[‘file’][‘name’]);
$extension = getExtension($filename);
$extension = strtolower($extension);
$filetype = $_FILES[“file”][“type”] == “image/jpg” || $_FILES[“file”][“type”] == “image/jpeg” || $_FILES[“file”][“type”] == “image/pjpeg” || $extension == “JPG” || $extension == “JPEG”;
if (!$filetype) {
// Do something
}
if ($filetype) {
// Do somethings
}
[/php]
The script is doing well as far as not excepting any format but jpg files. The problem is jpg files with caps as some cameras will save the extensions as caps like JPEG or JPG. These are not being accepted. I’ve also tried the following php:
[php]
$uploadedfile = $_FILES[‘file’][‘tmp_name’];
$filename = stripslashes($_FILES[‘file’][‘name’]);
$extension = getExtension($filename);
$extension = strtolower($extension);
$filetype = $_FILES[“file”][“type”] == “image/jpg” || $_FILES[“file”][“type”] == “image/jpeg” || $_FILES[“file”][“type”] == “image/pjpeg” || $_FILES[“file”][“type”] == “image/JPG” || $_FILES[“file”][“type”] == “image/JPEG”;
[/php]
This gives the same result where it will not except jpg’s with caps. Is there a way to make it work by making the change through php? if not is there a way to get it to except the extensions with caps.