You are here: Re: Inconsistent type checking results « PHP Programming Language « IT news, forums, messages
Re: Inconsistent type checking results

Posted by Shelly on 07/24/05 17:23

<pfrank26@hotmail.com> wrote in message
news:1122211729.994522.275720@o13g2000cwo.googlegroups.com...
> There are two main types of jpg in the system - jpeg and pjpeg. One
> solution is to use the PHP command getimagesize - see
> http://uk2.php.net/manual/en/function.getimagesize.php . The array it
> returns contains the type of image the supplied file is.
>

I'll try that (in a few weeks), but I am not sure I made myself clear to you
as to what my problem is. Let me clarify.

I use type=file in the html description of the field with a name of
name=filename. Then when I check the type from that one of the images is
"image" for the first five characters of the type, but the other is blank.
They are both jpg extensions. What I use is $_FILES['filename']['type'],
the global variable filled in by the file type textbox using the browse
button supplied.

Now from reading the documentation it seems to me that getimagesize() is a
server-side function to get the details on a file that is on the server. I
do the testing before actually uploading the file. This is standard
procedure. If the file is not of the proper type, the upload is not done.
Dos the getimagesize() work on a file on the user's system? I would think
not because that would allow the server to browse the user's system
indiscriminately, rather than merely looking at the supplied file -- a major
privacy breach.

Shelly

 

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

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