Page 1 of 1
Get File Size from Server directory after upload.
Posted: Wed Sep 29, 2010 8:48 pm
by thenndral
Hello,
I upload a movie file to server[Linux server].
After upload I would like to check, the upload file is properly uploaded or not. How to check it?
I need code for upload error handling and file size of my uploaded file from the server.
I need code help.Thanks so much.
Thanks in advance,
Thendral
Re: Get File Size from Server directory after upload.
Posted: Wed Sep 29, 2010 10:26 pm
by requinix
In the $_FILES array is the size of the uploaded file. If you don't believe HTTP and PHP are doing their job, print that number out and compare it with your local file's size.
Re: Get File Size from Server directory after upload.
Posted: Wed Sep 29, 2010 11:14 pm
by thenndral
Hi tasairis,
Sorry I can't able to understand.
I found some code,
I'm using move_uploaded_file for move file, so using conditional statement am checking. If it returns false, show message "Upload fails". See the code below,
if(move_uploaded_file($_FILES['adFile']['tmp_name'],"upload/" .
$_FILES["adFile"]["name"]))
{
echo "Stored in: " . "upload/" . $_FILES["adFile"]["name"];
} else {
echo "Error, couldn't save uploaded file.";
}
Can I use this way or could you give me some code sample.
Thanks,
Thendral
Re: Get File Size from Server directory after upload.
Posted: Wed Sep 29, 2010 11:27 pm
by requinix
tasairis wrote:In the $_FILES array is the size of the uploaded file.
Your first step is to find that number.
Your second step is to do whatever you want with that number.
Re: Get File Size from Server directory after upload.
Posted: Thu Sep 30, 2010 3:32 am
by thenndral
hi tasairis ,
Thank you, I fix it.
Thanks Again,
Thendral