...

View Full Version : Unable to upload TIF type image file in php



Saima Nazir
04-13-2012, 08:19 AM
This code work for all other images expect TIF type image of size 124KB..
where the problem lies???:confused:

if ((($_FILES["file"]["type"] == "image/gif")
|| ($_FILES["file"]["type"] == "image/jpeg")
|| ($_FILES["file"]["type"] == "image/TIF")
|| ($_FILES["file"]["type"] == "image/pjpeg"))
&& ($_FILES["file"]["size"] < 20000000))
{
if ($_FILES["file"]["error"] > 0)
{
echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
}
else
{
move_uploaded_file($_FILES["file"]["tmp_name"],"Fingerprints/" . $_FILES["file"]["name"]);
$path="Fingerprints/" . $_FILES["file"]["name"];
}
}
else
{
echo "Invalid file";
}

felgall
04-13-2012, 09:46 AM
Could it be because your code has TIF in uppercase and the type has it in lowercase?

Saima Nazir
04-13-2012, 02:45 PM
Changing it to lower case makes no difference...
still I am unable to upload it....

litebearer
04-13-2012, 04:29 PM
perhaps tiff (note 2 f's)
http://php.net/manual/en/function.exif-imagetype.php

Saima Nazir
04-15-2012, 10:03 AM
thnx...now it works...TIFF

litebearer
04-15-2012, 05:11 PM
hosting...

1. Bad manners to 'hijack' someone's thread.
2. Start a new thread
3. State the error/problem you are gettinghaving
4. Show your code (be sure to use the open/close php tags around your code)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum