You are here: Re: Files types « All PHP « IT news, forums, messages
Re: Files types

Posted by Janwillem Borleffs on 09/19/07 12:41

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация