Re: file upload and file size
| From: | dav | Date: | Thu, 08 Nov 2001 10:27:39 +0000 |
| Subject: | Re: file upload and file size | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-73856@lists.php.net to get a copy of this message | ||
you can get the file size only if file exist like:
$size = filesize("/www/docs/$name");
"Wilbert Enserink" <wilbert@pdd.nl> ha scritto nel messaggio
news:005701c1683d$94d58700$0301a8c0@168.1.1...
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--------