?
=?ISO-8859-15?Q?Roland_M=FCller?=
Hello Group,
i want to get the file size of some files located on a webserver,
therefore i create a WebRequest with the URI of the file and then a
WebResponse on the WebRequest to get the ContentLength:
WebRequest webRequest = HttpWebRequest.Create(fileUri);
webRequest.Method = "HEAD"; //??????? (*)
WebResponse webResponse = webRequest.GetResponse();
fileSizeBytes = (ulong)webResponse.ContentLength;
(*) Does this setting make the WebRequest only send the info and not the
complete file?
I ask because i don't want to download large files completely only to
get the filename.
Thank you very much in advance,
Roland
i want to get the file size of some files located on a webserver,
therefore i create a WebRequest with the URI of the file and then a
WebResponse on the WebRequest to get the ContentLength:
WebRequest webRequest = HttpWebRequest.Create(fileUri);
webRequest.Method = "HEAD"; //??????? (*)
WebResponse webResponse = webRequest.GetResponse();
fileSizeBytes = (ulong)webResponse.ContentLength;
(*) Does this setting make the WebRequest only send the info and not the
complete file?
I ask because i don't want to download large files completely only to
get the filename.
Thank you very much in advance,
Roland