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
Try this: I use it and got good result.
Now, test like these:
Results:
24.82 KiB
912 KiB
101.85 KiB
The simplest and most efficient implementation:
Php function
get_headers()
works for me to check the content-length asFor More Detail : PHP Function get_headers()
I'm not sure, but couldn't you use the get_headers function for this?
Try this code
Sure. Make a headers-only request and look for the
Content-Length
header.