<%
'------------------------------------------------ ----------
'Function: Get the remote file size
'Parameter: url remote file address
'Return: remote file size (unit: bytes)
'------------------------------------------------ ----------
Function getRemoteFileSize(url)
DimxmlHTTP
Set xmlHTTP = Server.CreateObject("MSXML2.XMLHTTP")
xmlHTTP.open "get", url, false
'The next sentence is very critical, otherwise all file information must be preloaded before returning the header information.
xmlHTTP.setRequestHeader "range", "bytes=-1"
xmlHTTP.send()
getRemoteFileSize = Split(xmlHTTP.GetResponseHeader("Content-Range"),"/")(1)
Set xmlHTTP = Nothing
End Function
Response.Write(getRemoteFileSize(" %>