Scripting.FileSystemObject GetFile method

F

fniles

Our client IIS uses NT Authentication and not anonymous.
We have XLS files in a different server than the IIS server, but both server
are in the same domain with IIS.
The user ids that are used are all in a group that has full control of the
directory where the XLS file that we want to access (say
\\myserver2\Work\myfilesFolder\).
But in the ASP page when using GetFile method to get to the XLS file, it
gets HTTP500 internal server error.
What causes this and how to fix it ?
Thank you.

This is the code:
sExcelPath = \\myserver2\Work\myFilesFolder\ExcelTemplate.xls
Set fso = CreateObject("Scripting.FileSystemObject")
Set f1 = fso.GetFile(sExcelPath) -> HTTP500 internal server error
 
B

Bob Barrows

fniles said:
Our client IIS uses NT Authentication and not anonymous.
We have XLS files in a different server than the IIS server, but both
server are in the same domain with IIS.
The user ids that are used are all in a group that has full control
of the directory where the XLS file that we want to access (say
\\myserver2\Work\myfilesFolder\).
But in the ASP page when using GetFile method to get to the XLS file,
it gets HTTP500 internal server error.
What causes this and how to fix it ?
Thank you.

This is the code:
sExcelPath = \\myserver2\Work\myFilesFolder\ExcelTemplate.xls
Set fso = CreateObject("Scripting.FileSystemObject")
Set f1 = fso.GetFile(sExcelPath) -> HTTP500 internal server error

First, turn off Friendly Errors in your browser so you can see the real
error message.
http://www.aspfaq.com/show.asp?id=2109
 
F

fniles

Thank you everybody.
They now turned off the friendly message.

Using "basic authentication" the fso.GetFile(sExcelPath) works fine, but
they do not want to use "basic authentication" because the password is sent
in clear text.
So, they try to use "digest authentication for windows domain servers".
When they do that, they got the following error:

Microsoft VBScript runtime error '800a0035'
File not found
/myIntranetSite/myTest.asp, line 7 -> this is on the
fso.GetFile(sExcelPath)

Why "digest authentication for windows domain servers" gave the above error
and how can we fix it ?

Thank you again.
 
A

Adrienne Boswell

Thank you everybody.
They now turned off the friendly message.

Using "basic authentication" the fso.GetFile(sExcelPath) works fine,
but they do not want to use "basic authentication" because the
password is sent in clear text.
So, they try to use "digest authentication for windows domain
servers". When they do that, they got the following error:

Microsoft VBScript runtime error '800a0035'
File not found
/myIntranetSite/myTest.asp, line 7 -> this is on the
fso.GetFile(sExcelPath)

What is the physical path? Does the file indicated exist at the physical
path?
Why "digest authentication for windows domain servers" gave the above
error and how can we fix it ?

That's not an authentication error, it's a file not found error, so there
is something going on there. Verify that the file exists at the
specified path.
 
F

fniles

The physical path is something like
\\myServer\Work\myCo\MyFolder\MyTemplate.xls

The file does exist, and if I use "basic authentication" it work fine, we
can get to the file.
Only doesn't work when I use "digest authentication for windows domain
servers"
 
A

Adrienne Boswell

Gazing into my crystal ball I observed "fniles" <[email protected]>
writing in
Please don't top post in Usenet. Top posting corrected.
The physical path is something like
\\myServer\Work\myCo\MyFolder\MyTemplate.xls

The file does exist, and if I use "basic authentication" it work fine,
we can get to the file.
Only doesn't work when I use "digest authentication for windows domain
servers"

What happens if you loop through the files in that directory? Does the
file show up that way? This is a file not found issue.
 
F

fniles

That's a good idea.

Do you happen to have a snippet of ASP codes to loop through files in a
directory ?
 
B

Bob Barrows

Adrienne said:
Gazing into my crystal ball I observed "fniles" <[email protected]>
writing in news:[email protected]:

That's not an authentication error, it's a file not found error, so
there is something going on there. Verify that the file exists at the
specified path.
Adrienne, I frequently get "file not found" errors when there are
permissions problems. You cannot dismiss permissions issues just because
the message says "file not found".

fmiles, if the file definitely exists in the specified location, then
you definitely do not have permissions set correctly for the user
accessing the website. I know you said "The user ids that are used are
all in a group that has full control of the directory where the XLS file
that we want to access " - all I can tell you is that this statement is
not true. The user id attempting to access the file is not in the group.
Verify this by putting in this line:

Response.Write "user id is '" & request.servervariables("logon_user") &
'"

If the result is blank, make sure your website has Anonymous unchecked.
 
B

Bob Barrows

Bob said:
fmiles, if the file definitely exists in the specified location, then
you definitely do not have permissions set correctly for the user
accessing the website. I know you said "The user ids that are used are
all in a group that has full control of the directory where the XLS
file that we want to access "

Incidently, these need to be filesystem permissions, not website
permissions. The FileSystemObject has no exposure to the website
permissions set via IIS Manager. All it knows about are the permissions
set on the file system via the operating system.
 
B

Bob Barrows

Bob said:
Incidently, these need to be filesystem permissions, not website
permissions. The FileSystemObject has no exposure to the website
permissions set via IIS Manager. All it knows about are the
permissions set on the file system via the operating system.
Sorry, this advice only applies to files on the local server.
 
F

fniles

Do you suggest me checking if the request.servervariables("logon_user") has
permission to the file I am trying to access ?

Thank you.
 
A

Adrienne Boswell

Gazing into my crystal ball I observed "Bob Barrows" <reb01501
@NOyahoo.SPAMcom> writing in
Adrienne, I frequently get "file not found" errors when there are
permissions problems. You cannot dismiss permissions issues just because
the message says "file not found".

Thanks, Bob. I did not know that. You would think "file not found"
means exactly that. You would think that if it were a permissions
problem, it would say "permission denied" not "file not found". Oh well,
live and learn.
 
B

Bob Barrows

Adrienne said:
Gazing into my crystal ball I observed "Bob Barrows" <reb01501
@NOyahoo.SPAMcom> writing in


Thanks, Bob. I did not know that. You would think "file not found"
means exactly that. You would think that if it were a permissions
problem, it would say "permission denied" not "file not found". Oh
well, live and learn.
I think the difference is, in the first place you had sufficient
permissions to locate the file but attempted to do something to it for
which you have no permission.
 
B

Bob Barrows

No, I failed to realize you were trying to access a file on a remote
server. Look at the aspfaq article I posted in another message.
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,905
Latest member
Kristy_Poole

Latest Threads

Top