RE: [PHP] File upload: type and size question
| From: | Sævar Öfjörð | Date: | Tue, 01 Jul 2003 20:30:09 +0000 |
| Subject: | RE: [PHP] File upload: type and size question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-153612@lists.php.net to get a copy of this message | ||
http://is.php.net/manual/en/features.file-upload.php
There you can see how to use the $_FILES autoglobals ($HTTP_POST_FILES
in php versions prior 4.1.0) to get the size of the uploaded file in
bytes.
So, for example, you can do this before saving the uploaded file:
if($_FILES['userfile']['size'] > $maxsize){
echo "Error. The file was to large. Max file size is $maxsize.";
}
-----Original Message-----
From: Dani Matielo [mailto:dmatielo@uol.com.br]
Sent: 1. júlí 2003 14:25
To: php-general@lists.php.net
Subject: [PHP] File upload: type and size question
Hello,
could someone help me? I am trying to limit the type and size of the
files
to be uploaded, but I can't find how to do this. I have seen examples on
how
to limit to image types, with the MIME function. The problem is, the
type of
file I want is audio, extensions MP3 or WAV. The max file size should be
150Kb.
Thank you for your help! :))
Dani
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.488 / Virus Database: 287 - Release Date: 5/6/2003
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php