tags:

views:

30

answers:

2

Is it possible to get file properties of a web file. ie: PDF file and get the date and time the PDF file was modified. Thanks.

+1  A: 

You're probably looking for the HttpWebResponse.LastModified property.

Mike Atlas
+1  A: 

No, you can't. It's not a file, it's a resource.

When you request it from the server you get a response back. In this case the server uses a file as source for the resource, but it could just as well be something that is just created on the fly. You only get the information that the server chooses to put in the HTML header.

You might however be able to get some more information if the server returns directory information. Then you could request the folder and get a listing back, from which you could parse some information. Note however that it's not certain that the server actually uses the files when you request something from the directory, it could still return something completely different. Also, the directory listing is also a resource, so there is no guarantee that it's relevant either.

Guffa