On an Intranet app, I want the user to be able to click the word Files, and
be taken to the folder that exists for that particular ticket. On a server
on our network, we have a folder called tickets, and inside, if anyone has
created a folder for a given ticket, it will have the naming convention of
T, then the ticket number. So Ticket #1000 will have a folder called T1000,
and it will be located on the folder called Tickets on that server.
However, if no folder has been created, then I want it to take them to the
root of the Tickets folder. Here's the code, with problem listed below that.
SET fso = CreateObject("Scripting.FileSystemObject")
strTraceDir = "\\servername\tickets\T"&strTicketID
If fso.FolderExists (strTraceDir) then
'don't change anything
Else
strTraceDir = "\\servername\tickets\"
End if
set fso= nothing
%>
<a href="<%=strTraceDir%>" target="_blank">Files:</a>
------------------------------------
For some reason, it is falling into the Else no matter what. Even though the
folder exists, it acts as if it doesn't. It jsut takes you to the root of
Tickets.
I did a response.write on several things, and confirmed that the strTicketID
variable is properly populated. What am I missing? 3 3233
Dim FSO
Dim Fldr
Set FSO = CreateObject("Scripting.FileSystemObject")
Set Fldr = FSO.GetFolder(Server.MapPath(""\\servername\ticket s"))
If FSO.FolderExists(Server.MapPath(Fldr.Name & "\T"& strTicketID")) Then
'it is there
'Do something
Else 'It's not there
'Do something else
End If
--
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)
middletree <mi********@htomail.com> wrote in message
news:#D**************@TK2MSFTNGP12.phx.gbl... On an Intranet app, I want the user to be able to click the word Files,
and be taken to the folder that exists for that particular ticket. On a
server on our network, we have a folder called tickets, and inside, if anyone has created a folder for a given ticket, it will have the naming convention of T, then the ticket number. So Ticket #1000 will have a folder called
T1000, and it will be located on the folder called Tickets on that server.
However, if no folder has been created, then I want it to take them to the root of the Tickets folder. Here's the code, with problem listed below
that. SET fso = CreateObject("Scripting.FileSystemObject") strTraceDir = "\\servername\tickets\T"&strTicketID If fso.FolderExists (strTraceDir) then 'don't change anything Else strTraceDir = "\\servername\tickets\" End if set fso= nothing %>
<a href="<%=strTraceDir%>" target="_blank">Files:</a>
------------------------------------ For some reason, it is falling into the Else no matter what. Even though
the folder exists, it acts as if it doesn't. It jsut takes you to the root of Tickets.
I did a response.write on several things, and confirmed that the
strTicketID variable is properly populated. What am I missing?
Are you sure IUSR has permissions to the \\servername\tickets\ folder?
"middletree" <mi********@htomail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl... On an Intranet app, I want the user to be able to click the word Files,
and be taken to the folder that exists for that particular ticket. On a
server on our network, we have a folder called tickets, and inside, if anyone has created a folder for a given ticket, it will have the naming convention of T, then the ticket number. So Ticket #1000 will have a folder called
T1000, and it will be located on the folder called Tickets on that server.
However, if no folder has been created, then I want it to take them to the root of the Tickets folder. Here's the code, with problem listed below
that. SET fso = CreateObject("Scripting.FileSystemObject") strTraceDir = "\\servername\tickets\T"&strTicketID If fso.FolderExists (strTraceDir) then 'don't change anything Else strTraceDir = "\\servername\tickets\" End if set fso= nothing %>
<a href="<%=strTraceDir%>" target="_blank">Files:</a>
------------------------------------ For some reason, it is falling into the Else no matter what. Even though
the folder exists, it acts as if it doesn't. It jsut takes you to the root of Tickets.
I did a response.write on several things, and confirmed that the
strTicketID variable is properly populated. What am I missing?
Yes, I am.
I am not sure why, but it began working all of a sudden.
"Foo Man Chew" <fo*@man.chew> wrote in message
news:#O**************@TK2MSFTNGP12.phx.gbl... Are you sure IUSR has permissions to the \\servername\tickets\ folder? "middletree" <mi********@htomail.com> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl... On an Intranet app, I want the user to be able to click the word Files, and be taken to the folder that exists for that particular ticket. On a server on our network, we have a folder called tickets, and inside, if anyone
has created a folder for a given ticket, it will have the naming convention
of T, then the ticket number. So Ticket #1000 will have a folder called T1000, and it will be located on the folder called Tickets on that server.
However, if no folder has been created, then I want it to take them to
the root of the Tickets folder. Here's the code, with problem listed below that. SET fso = CreateObject("Scripting.FileSystemObject") strTraceDir = "\\servername\tickets\T"&strTicketID If fso.FolderExists (strTraceDir) then 'don't change anything Else strTraceDir = "\\servername\tickets\" End if set fso= nothing %>
<a href="<%=strTraceDir%>" target="_blank">Files:</a>
------------------------------------ For some reason, it is falling into the Else no matter what. Even though
the folder exists, it acts as if it doesn't. It jsut takes you to the root
of Tickets.
I did a response.write on several things, and confirmed that the strTicketID variable is properly populated. What am I missing?
This discussion thread is closed Replies have been disabled for this discussion. Similar topics
reply
views
Thread by Bruce Davis |
last post: by
|
11 posts
views
Thread by Kostatus |
last post: by
|
reply
views
Thread by Refky Wahib |
last post: by
|
117 posts
views
Thread by Peter Olcott |
last post: by
|
1 post
views
Thread by Jeff |
last post: by
|
28 posts
views
Thread by Jon Davis |
last post: by
|
6 posts
views
Thread by Ammar |
last post: by
|
16 posts
views
Thread by Dany |
last post: by
|
2 posts
views
Thread by Mike Collins |
last post: by
| | | | | | | | | | |