Re: file upload and file size
| From: | Stefan Rusterholz | Date: | Thu, 08 Nov 2001 11:55:35 +0000 |
| Subject: | Re: file upload and file size | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-73869@lists.php.net to get a copy of this message | ||
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--------