J
|
Jane 7/14/2008 |
Hi, |
I
|
indigo author 7/14/2008 |
Could you please elaborate. I tried doing and could not do it properly... |
K
|
kdeloach 7/14/2008 |
Could you please elaborate. I tried doing and could not do it properly... How do I achieve checking of filetypes?
|
I
|
indigo author 7/16/2008 |
Hi, |
J
|
Jane 7/16/2008 |
Hi, $img = imagecreatefromstring($value);
$img = @imagecreatefromstring($value); |
I
|
indigo author 7/16/2008 |
Hi Jane, $file = $_FILES["value_Photo2"]["name"]; $ext = basename( $n=substr($file, strpos($file, '.')+1) ); $images = array( 'jpg', 'jpeg', 'gif', 'png' ); if( in_array($ext, $images) ){ echo "Files is an image"; return true; } else { echo "Error - file is not an image"; return false; }
|
J
|
Jane 7/17/2008 |
It's difficult to tell you what's happening without seeing actual files. |
M
|
mustafa 11/7/2008 |
Could you please elaborate. I tried doing and could not do it properly... How do I achieve checking of filetypes?
function CreateThumbnail($value, $size, $ext) { [color=#990000]if($ext==".GIF" || $ext==".JPG" || $ext=="JPEG" || $ext==".PNG" || $ext==".BMP") { if(!function_exists("imagecreatefromstring")) return $value; $img = imagecreatefromstring($value); . . . } [color=#666666]// function ends
|
M
|
mustafa 11/8/2008 |
2- in the Before record added/updated events (*)
$_FILES["value_logo"]["name"] = trim($_FILES["value_logo"]["name"]); $ext = CheckImageExtension($_FILES["value_logo"]["name"]); if (!($_FILES["value_logo"]["name"])){ return true; } else { if ($ext) { return true; } else { $message = "Please select an image file as your LOGO!"; return false; } }
|