> Is it possible to check a file in $_FILES['userfile']['tmp_name'] to
> make sure it is of a certain format? I want to allow a user to only
> upload jpegs or mpegs, and want to check what format the file is in.
If there are only a few types, and you know what those types should look
like, it sho
Thank you for your reply.
A little background on what Im doing with file uploading.
1. Im allowing registered users to upload avatars for their own usage.
2. Im allowing image uploading for submitted articles by certain
registered users.
3. And Im currently constructing a media gallery, where i
> So, check $_FILES['userfile']['type'] against a set of allowed file
> types, and you're set...
What about this:
array getimagesize ( string filename [, array imageinfo])
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
David Otton wrote:
On Mon, 14 Jul 2003 00:24:03 -0400, you wrote:
... The show-resource.php script just has to set
the correct mime type header and stream out the contents of the file.
And it is safe to use the browser supplied mime type here.
--
PHP General Mailing List (http://www.php.net/)
To
On Mon, 14 Jul 2003 00:24:03 -0400, you wrote:
>Looking for opinions. Can a spoofed uploaded file hurt a script or a
>webserver??
>Reason why Im asking is because, I looked over the magic.mime file on my
>server, and I see that it
>doesn't support flash files (I may be wrong), of which I curren
Gerard Samuel wrote:
A client-supplied value isn't going to be too useful - it can be
spoofed, or
may not be present. (I believe a Windows browser would set the mime-type
based purely on the file extension, though I haven't tested this
myself).
Then my apologies. I thought php determined the f
David Otton wrote:
$_FILES['userfile']['type']
The mime type of the file, if the browser provided this
information. An example would be "image/gif".
So, check $_FILES['userfile']['type'] against a set of allowed file
types, and you're set...
A client-supplied value isn't going
On Sun, 13 Jul 2003 13:32:00 -0400, you wrote:
>The upload process, already collects info on file types when you upload.
> From the manual ->
>
>> $_FILES['userfile']['type']
>>
>> The mime type of the file, if the browser provided this
>> information. An example would be "image/gif".
>>
>
The upload process, already collects info on file types when you upload.
From the manual ->
$_FILES['userfile']['type']
The mime type of the file, if the browser provided this
information. An example would be "image/gif".
So, check $_FILES['userfile']['type'] against a set of allowed file
If you have compiled php with --enable-mime-magic, you can use
mime_content_type()
Dan Anderson wrote:
Is it possible to check a file in $_FILES['userfile']['tmp_name'] to
make sure it is of a certain format? I want to allow a user to only
upload jpegs or mpegs, and want to check what format th
On Sunday 13 July 2003 01:24, Dan Anderson wrote:
> Is it possible to check a file in $_FILES['userfile']['tmp_name'] to
> make sure it is of a certain format? I want to allow a user to only
> upload jpegs or mpegs, and want to check what format the file is in.
If on un*x you can use the 'file' p
Is it possible to check a file in $_FILES['userfile']['tmp_name'] to
make sure it is of a certain format? I want to allow a user to only
upload jpegs or mpegs, and want to check what format the file is in.
Thanks in advance,
Dan Anderson
--
PHP General Mailing List (http://www.php.net/)
To un
12 matches
Mail list logo