Files types



Can anyone point me in the right direction. I am trying to upload jpg images and using the following piece of code
$myerror = "no";
$msg = "ok";
$img_types = array('image/jpeg','image/jpg','image/pjpeg');
if (!in_array($_FILES['imagefile']['type'],$img_types))
{
$msg = 'Problem: file is not jpg';
$myerror = "yes";
}
echo $msg;
When I try to download a jpg I still get the problem msg.
Is there something that I am doing wrong that I cant see or is there another way to do this.
Thanks in advance

Bill
.



Relevant Pages

  • Re: Files types
    ... echo $msg; ... When I try to download a jpg I still get the problem msg. ... echo $newname; ... looking at the output in the browser. ...
    (alt.php)
  • Re: mime types
    ... bill wrote: ... $msg = 'Problem: file is not jpg'; ... when uploading a jpg or jpeg this works fine in firefox but when i try to upload a jpg using internet explorer an error is produced saying that it is not a jpg when in fact it is. ...
    (alt.php)
  • Re: mime types
    ... $msg = 'Problem: file is not jpg'; ... to upload a jpg using internet explorer an error is produced saying that ... allows jpg to the server but the server still says its not a jpg. ...
    (alt.php)
  • Re: Files types
    ... echo $msg; ... When I try to download a jpg I still get the problem msg. ... echo $newname; ...
    (alt.php)