Home All Groups Group Topic Archive Search About

Get file informations form web URLs

Author
22 May 2006 7:58 AM
Emanuele Ornella
I used the FileInfo class to obtain informations about files in the
file system.
I would like to have the same informations for a file in a web url, but
I cannot use FileInfo.
I discovered WebClient from the System.Net namespace, but this gives me
a FileStream in return and not a FileInfo.

Any way to convert a FileStream into FileInfo? Or rather any other way
to have these informations?

Thanks in advance,
ema

Author
22 May 2006 8:42 AM
Vadym Stetsyak
Hello, Emanuele!

EO> I used the FileInfo class to obtain informations about files in the
EO> file system.
EO> I would like to have the same informations for a file in a web url, but
EO> I cannot use FileInfo.
EO> I discovered WebClient from the System.Net namespace, but this gives me
EO> a FileStream in return and not a FileInfo.

EO> Any way to convert a FileStream into FileInfo? Or rather any other way
EO> to have these informations?

You can use UNC path to obtain the same FileInfo. File path will look like
\\server\folder\file.ext

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Author
22 May 2006 2:45 PM
Emanuele Ornella
Hello Vadym,
UNC path? Where can I get it?
The only UNC method I found on DSN is from namespace
System.Data.SqlServerCe !!

ema
Author
22 May 2006 3:13 PM
Carl Daniel [VC++ MVP]
Emanuele Ornella wrote:
> I used the FileInfo class to obtain informations about files in the
> file system.
> I would like to have the same informations for a file in a web url,
> but I cannot use FileInfo.
> I discovered WebClient from the System.Net namespace, but this gives
> me a FileStream in return and not a FileInfo.
>
> Any way to convert a FileStream into FileInfo? Or rather any other way
> to have these informations?

No, there is not.  Access via an URL generally doesn't provide any
information about the resource other than a name and possibly a
last-modified date.  If you need more information than that, you need more
access than you're going to get via a URL.

-cd
Author
23 May 2006 6:06 AM
Emanuele Ornella
Show quote
> No, there is not.  Access via an URL generally doesn't provide any
> information about the resource other than a name and possibly a
> last-modified date.  If you need more information than that, you need more
> access than you're going to get via a URL.
>
Thanks!
ema

AddThis Social Bookmark Button