Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How To Verify file:\\ hyperlinks 1

Status
Not open for further replies.

SmokeEater

Technical User
Feb 14, 2002
90
0
0
CA
I have been able to check http:// hyperlinks on my website, using this function, which I found on Tek-Tips.
Code:
Private Function File(byVal pathname)
    Dim objFSO
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    File = objFSO.FileExists(pathname)
    Set objFSO = Nothing
End Function
My problem is I have some hyperlinks using file://
How do I check these links?

 
Oh, I forgot to mention that the file:// hyperlinks point to pdf's that are located on another server.
 
the script above doesn't check for hyperlinks. can you be more clear on what you are doing. are you finding broker links or testing availability of pages

Oh, I forgot to mention that the file:// hyperlinks point to pdf's that are located on another server.

you can do that with the script above using a unc path


General FAQ faq333-2924
5 steps to asking a question faq333-3811
 
if you're using file://drive/path/etc

you could try to just replace, file://drive with drive: and replace all "/" with "\" then feed it through your function.

this should at least report if the system is seeing the correct mapped drives, or virtual paths.

[thumbsup2]DreX
aKa - Robert
if all else fails, light it on fire and do the happy dance!
" I always think outside the 'box', because I'm never inside the 'loop' " - DreX 2005
 
onpnt, What I am trying to do is test the availability of pdf files.
 
DreXor, if I use a UNC instead of a letter drive, should things work the same. (ie. \\server\directory\file.PDF)
 
that should work as well you just have to make sure the server_system has access to wahtaever drive as well as the iusr_server account for your web server on the destination machine... example, if your web server is called WEB, and your computer holding the pdf's is called FILE..

on the machine FILE you have to add accounts IUSR_WEB with read permissions on the pdf folder as well as SYSTEM_WEB

that should help alieviate the problem some

[thumbsup2]DreX
aKa - Robert
if all else fails, light it on fire and do the happy dance!
" I always think outside the 'box', because I'm never inside the 'loop' " - DreX 2005
 
Actually UNC paths may give you difficulties with the FileSystemObject, it depends on what user your ASP scripts are runing under and the permissions that user has to access UNC paths on your network. For instance, if your running with Anonymous access your going to be trying to access the UNC path from the default IIS user (IUSR_machinename) which likely won't have access.

-T

barcode_1.gif
 
Whoops, I guess I should have read the rest of Drex's post :p


barcode_1.gif
 
If you are trying to see if a file exists on another webserver by using an http:// type path, Then you can use XMLHTTP. Its really cool, DotNetGnat sorted me out a few moths ago. Do a search for it here and you should find what you are looking for.

[sub]"Nothing is impossible until proven otherwise"[/sub]​
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top