|
-
Jun 28th, 2004, 07:56 AM
#1
Thread Starter
Fanatic Member
Does a file exist using the URL
Is there anyway in .net to find out if a file exists using its URL as opposed to its physical path ?
-
Jun 28th, 2004, 08:56 AM
#2
Addicted Member
I'm not sure if .NET has a better way of checkings links or a better object, but about a year ago my team was faced with a similar problem. We found an XML Object that will simulate a request to a page and return whether it was a valid link or not.
Anyway I hope this works for you:
Code:
Set objHTTP = Server.CreateObject("Microsoft.XMLHTTP")
objHTTP.Open "get", strURL, False
objHTTP.Send
httpStatus = objHTTP.status
If httpStatus <> "200" Then
'link was not valid
End If
-
Jun 28th, 2004, 09:15 AM
#3
Frenzied Member
What is wrong with doing a MapPath and System.IO.File.Exists(path)?
I'm just curious when and why this is inefficient or won't work. The only time I know of is if you have a client checking for a page. Is that the case?
Magiaus
If I helped give me some points.
-
Jun 29th, 2004, 05:17 AM
#4
Thread Starter
Fanatic Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|