FileSystemObject does not see folder on network

M

middletree

I'm on an Intranet, and our Intranet server is on the same domain as the
users. I have one place where I wanted to create a clickable link which
would take the user to the directory for that Ticket. So if you're on the
page for Ticket 1000, the word "Files" is surrounded by this:
<a href=\\servername\tickets\<%=strTicketid%> target="_blank">Files</a>

This works fine if the directory exists. (Not every ticket has a
corresponding folder). But if it doesn't exist, users who click the link
will get an empty window.

This is not the end of the world, but it would be nice to have the page see
if the folder exists, and if not, don't have the link.

In my testing of the FileSystemObject, using the "FolderExists", it works
fine on my machine. But not when it's on anohter machine. I have tried it
using the above naming convention, and also with the dirve letter that
everyone has mapped to this folder, and neither way works.

I went to ASPFAQ.com, but didn't find anything that addresses this
situation.
 
T

TomB

Set your security to use Integrated authentication then your user's identity
will be used to check if the file exists rather than the local (to the
webserver) account of IUSR_machinename which, of course, has no rights to
\\servername\tickerts\1000
 
S

Steven Burn

Below is the folder exists function I use...... might be worth a try?

If ReportFolderStatus(Server.MapPath("users" & "\" & strName)) = "1" Then
'Folder exists...... do something
Else
'Folder doesn't exist..... do something else
End If

Function ReportFolderStatus(fldr)
Set fso = CreateObject("Scripting.FileSystemObject")
If (fso.FolderExists(fldr)) Then
msg = "1" 'True
Else
msg = "0" 'False
End If
ReportFolderStatus = msg
End Function

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
 
A

Aaron Bertrand - MVP

And, what part of the article did you implement? On the system where the
share is physically hosted, you created an account with IUSR_machinename
(for the machinename where this doesn't work), synchronized the passwords on
both the hosting machine and the machine that is trying to access it, and it
still doesn't work? What does "doesn't work" mean? Do you get an error
message? If so, what is it? Without knowing what "neither way works"
means... and of course, whether or not you actually implemented the
suggestion in the link I sent, we would not be able to determine what is
wrong, never mind how to fix it.
 
M

middletree

Well, I didn't think it was incumbent upon me to list every step I did in
trying to solve this, but here goes:

In the article referenced, the first section is titled "If the file is
outside your LAN"
so we can rule that out.

The next section is for those who have files inside the LAN. The first line,
about using Windows Authentication, does apply to me, so I click that, and I
get a MS KB article which says what to do if you get any of a list of
errors, but I wasn't getting any. I was just getting that the folder doesn't
exist, even if it does.

Back to the article: I can rule out Novell, and the virtual server stuff. I
stop at this point and make my post.

I then go into IIS and see that on one machine, I have Integrated Windows
Authentication checked, and on the one where I was having the problem, it
wasn't. So I checked it and all is fine.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top