Re: file upload and file size
| From: | Andrey Hristov | Date: | Thu, 08 Nov 2001 11:58:40 +0000 |
| Subject: | Re: file upload and file size | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-73871@lists.php.net to get a copy of this message | ||
I think that it is clear :
<input type="file" name="userfile">
$HTTP_POST_FILES['userfile']['size']
Andrey Hristov
IcyGEN Corporation
http://www.icygen.com
BALANCED SOLUTIONS
----- Original Message -----
From: "Stefan Rusterholz" <scripting@interaktion.ch>
To: "Wilbert Enserink" <wilbert@pdd.nl>
Cc: <php-general@lists.php.net>
Sent: Thursday, November 08, 2001 1:55 PM
Subject: Re: [PHP] file upload and file size
> If you have the file's content hold in a variable you can try
> strlen($filecontent) - this works quit good for me.
>
> Hope I could help you
> Stefan Rusterholz, s.rusterholz@interaktion.ch
> ----------------------------------
> interaktion gmbh
> Stefan Rusterholz
> Zürichbergstrasse 17
> 8032 Zürich
> ----------------------------------
> T. +41 1 253 19 55
> F. +41 1 253 19 56
> W3 www.interaktion.ch
> ----------------------------------
>
> ----- Original Message -----
> From: "Wilbert Enserink" <wilbert@pdd.nl>
> To: <php-general@lists.php.net>
> Sent: Thursday, November 08, 2001 11:10 AM
> Subject: [PHP] file upload and file size
>
>
> Hi all,
>
>
>
> I'm busy writing a script for file upload and then showing the details of
> the uploaded file.
> renaming the file and moving it to a specified dir goes ok. but showing
> detals doesn't do it right.
> I already searched on php.net for some details, but somewehere i'm doing
> stuff wrong. Anybody got any ideas?
>
> regards,
>
> Wilbert
>
>
> --------my code-----
>
> <?php
> if (is_uploaded_file($userfile)) {
> $new_location="path_to_new_file_dir"
> move_uploaded_file($userfile, "$new_location/$userfile_name");
> } else {
> echo "Possible file upload attack: filename '$userfile'.";
> }
>
> $file_size = filesize("$new_location/$userfile_name");
> echo "file size=" & $file_size;
> ?>
>
> --------end--------
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>