Size of remote file
Hi!
I am trying to acquire the size of a remote file (accessed via a URL) so I can print that to the user in my download prompt. I checked GetFileSizeEx(), but that seems to be only for local files.
What language and API? How are you downloading the file? If it's via a URL, there isn't necessarily any guarantee the server will tell you the size, it may just keep sending bytes and then close the connection when it's transferred.
The web server may send its size in an accompanying header (content-length). However, like Steve pointed out, there are no guarantees that the information is correct or at all present.
Quote:Original post by EldritchWhat functions are you using for the network side? WinSock? There's no magical GetFileFromRemoteServer() function that I know of.
Sorry, I am using WINAPI and C/C++. How would I do to access this header?
The header is sent as part of the HTTP request, which you'll have to parse if you're doing the network code yourself.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement