Posted by Bill on 09/19/07 14:22
Janwillem Borleffs wrote:
> Bill schreef:
>> 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
>>
>
> What is the output when you print $_FILES['imagefile']['type']?
>
>
> JW
i tried
$newname = $_FILES['imagefile']['type'];
echo $newname;
and got nothing.
Is there something I have to do to make this work
Thanks
Navigation:
[Reply to this message]
|