How do you calculate video file size when user upload

Hi experts,

As the question above, I want to limit video file size when user upload to under e.g. 5 Mb or not longer than 5 minutes. How can I do that.
This is the code that I use. I just don’t know how to calculate the file size and it’s not effective.


if ((($_FILES["video"]["type"] == "video/mp4")
	|| ($_FILES["video"]["type"] == "video/ogg"))
	&& ($_FILES["video"]["size"] < 200000000000000000)) {
}

Thanks

Php has to upload the file before it can get its size. I belive Javascript can check the size before upload.

Thanks,

Sound a lot of headache waiting ahead.

Which is why I let a third-party service, like Youtube, handle all forms of user submitted videos.