How to get HTTP headers of any remote file?
Want to check Content-Type or Content-Length of a remote file without downloading whole file?
Then you should just request headers and not whole file from a remote server using HTTP protocol.
Here’s how to do this in PHP using fsockopen or cURL.