Is there a way to get the size of a remote file http://my_url/my_file.txt without downloading the file?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
Since this question is already tagged "php" and "curl", I'm assuming you know how to use Curl in PHP.
If you set
curl_setopt(CURLOPT_NOBODY, TRUE)
then you will make a HEAD request and can probably check the "Content-Length" header of the response, which will be only headers.