|
 |
asp_web_howto thread: Problem reading a remote file ...
Message #1 by "Melissa Mussitsch" <melissa.mussitsch@a...> on Tue, 7 May 2002 19:40:11
|
|
This is strange. I have a remote text file I'm trying to open using the
FileSystemObject currently (though eventually I just need to email it as
an attachment). In IIS on the web server, we created a virtual directory
pointing to the remote folder containing the text file. In code, I can
say the following:
strFilePath = keys\file.txt
response.redirect strFilePath
And it works fine and displays the actual file.
But using the FileSystemObject, I comment out the redirect line and say:
set fs = CreateObject("Scripting.FileSystemObject")
set ts = fs.OpenTextFile(strFilePath,1)
I get the error message:
Microsoft VBScript runtime error '800a004c'
Path not found
Any idea why I can read it to redirect to it, but can't read it in line
for line?
Thanks.
Melissa Mussitsch
Message #2 by Jack_Speranza <jsperanza@g...> on Tue, 7 May 2002 14:50:08 -0400
|
|
I don't believe the physical path gets translated for the FSO when you rely
on the virtual directory structure... try using the server.mapPath method to
translate the path for you...
also, you might need to adjust your security settings on the actual folder
and file (if NTFS)... FSO
will be running under the context of the IIS anonymous user...
-----Original Message-----
From: Melissa Mussitsch [mailto:melissa.mussitsch@a...]
Sent: Tuesday, May 07, 2002 3:40 PM
To: ASP Web HowTo
Subject: [asp_web_howto] Problem reading a remote file ...
This is strange. I have a remote text file I'm trying to open using the
FileSystemObject currently (though eventually I just need to email it as
an attachment). In IIS on the web server, we created a virtual directory
pointing to the remote folder containing the text file. In code, I can
say the following:
strFilePath = keys\file.txt
response.redirect strFilePath
And it works fine and displays the actual file.
But using the FileSystemObject, I comment out the redirect line and say:
set fs = CreateObject("Scripting.FileSystemObject")
set ts = fs.OpenTextFile(strFilePath,1)
I get the error message:
Microsoft VBScript runtime error '800a004c'
Path not found
Any idea why I can read it to redirect to it, but can't read it in line
for line?
Thanks.
Melissa Mussitsch
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20
|
|
 |