Home All Groups Group Topic Archive Search About

Scripting.FileSystemObject GetFile method

Author
2 May 2009 3:07 PM
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

Author
2 May 2009 4:32 PM
Bob Barrows
fniles wrote:
Show quoteHide quote
> 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


--
Microsoft MVP - ASP/ASP.NET - 2004-2007
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Are all your drivers up to date? click for free checkup

Author
4 May 2009 12:43 AM
Roberto Franceschetti
If you're using "Integrated Windows Authentication" in the Directory
Security tab under authentication methods, this only allows IIS to have
a security token that grants authenticated users to resources local on
the IIS server itself, they won't have network access. If you remove
integrated authentication, and enable only "Basic Authentication", users
will be prompted with a username/password dialog box that will allow
them to authenticate. Now IIS will have the complete user's credentials,
and will allow them access to the network shares.

--
Roberto Franceschetti
LogSat Software
http://www.logsat.com


fniles wrote:
Show quoteHide quote
> 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
>
>
Author
6 May 2009 8:32 PM
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.

Show quoteHide quote
"Roberto Franceschetti" <roberto_remove_t***@logsat.com> wrote in message
news:49fe3a29$0$11839$9a6e19ea@unlimited.newshosting.com...
> If you're using "Integrated Windows Authentication" in the Directory
> Security tab under authentication methods, this only allows IIS to have a
> security token that grants authenticated users to resources local on the
> IIS server itself, they won't have network access. If you remove
> integrated authentication, and enable only "Basic Authentication", users
> will be prompted with a username/password dialog box that will allow them
> to authenticate. Now IIS will have the complete user's credentials, and
> will allow them access to the network shares.
>
> --
> Roberto Franceschetti
> LogSat Software
> http://www.logsat.com
>
>
> fniles wrote:
>> 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
Author
7 May 2009 2:02 PM
Adrienne Boswell
Show quote Hide quote
Gazing into my crystal ball I observed "fniles" <fni***@pfmail.com>
writing in news:uXd0WnozJHA.140@TK2MSFTNGP03.phx.gbl:

> 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.




--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
Author
7 May 2009 7:37 PM
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"

Show quoteHide quote
"Adrienne Boswell" <arb***@yahoo.com> wrote in message
news:Xns9C04478C4DC3arbpenyahoocom@207.115.33.102...
> Gazing into my crystal ball I observed "fniles" <fni***@pfmail.com>
> writing in news:uXd0WnozJHA.140@TK2MSFTNGP03.phx.gbl:
>
>> 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.
>
>
>
>
> --
> Adrienne Boswell at Home
> Arbpen Web Site Design Services
> http://www.cavalcade-of-coding.info
> Please respond to the group so others can share
>
Author
8 May 2009 2:02 PM
Adrienne Boswell
Gazing into my crystal ball I observed "fniles" <fni***@pfmail.com>
writing in news:e48$Ut0zJHA.2656@TK2MSFTNGP05.phx.gbl:

Please don't top post in Usenet.  Top posting corrected.

Show quoteHide quote
> "Adrienne Boswell" <arb***@yahoo.com> wrote in message
> news:Xns9C04478C4DC3arbpenyahoocom@207.115.33.102...
>> Gazing into my crystal ball I observed "fniles" <fni***@pfmail.com>
>> writing in news:uXd0WnozJHA.140@TK2MSFTNGP03.phx.gbl:
>>
>>> 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.
>>
> 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.


--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
Author
8 May 2009 2:50 PM
fniles
That's a good idea.

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

Show quoteHide quote
"Adrienne Boswell" <arb***@yahoo.com> wrote in message
news:Xns9C0547969F11Barbpenyahoocom@207.115.33.102...
> Gazing into my crystal ball I observed "fniles" <fni***@pfmail.com>
> writing in news:e48$Ut0zJHA.2656@TK2MSFTNGP05.phx.gbl:
>
> Please don't top post in Usenet.  Top posting corrected.
>
>> "Adrienne Boswell" <arb***@yahoo.com> wrote in message
>> news:Xns9C04478C4DC3arbpenyahoocom@207.115.33.102...
>>> Gazing into my crystal ball I observed "fniles" <fni***@pfmail.com>
>>> writing in news:uXd0WnozJHA.140@TK2MSFTNGP03.phx.gbl:
>>>
>>>> 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.
>>>
>> 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.
>
>
> --
> Adrienne Boswell at Home
> Arbpen Web Site Design Services
> http://www.cavalcade-of-coding.info
> Please respond to the group so others can share
>
Author
8 May 2009 3:07 PM
Bob Barrows
Adrienne Boswell wrote:
> Gazing into my crystal ball I observed "fniles" <fni***@pfmail.com>
> writing in news:uXd0WnozJHA.140@TK2MSFTNGP03.phx.gbl:

>> 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.
>
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.

--
HTH,
Bob Barrows
Author
8 May 2009 3:13 PM
Bob Barrows
Bob Barrows wrote:
>
> 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.

--
HTH,
Bob Barrows
Author
8 May 2009 3:19 PM
Bob Barrows
Bob Barrows wrote:
> Bob Barrows wrote:
>>
>> 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.
>
Sorry, this advice only applies to files on the local server.

--
HTH,
Bob Barrows
Author
8 May 2009 4:11 PM
fniles
Do you suggest me checking if the request.servervariables("logon_user") has
permission to the file I am trying to access ?

Thank you.

Show quoteHide quote
"Bob Barrows" <reb01501@NOyahoo.SPAMcom> wrote in message
news:%23LBk99%23zJHA.4736@TK2MSFTNGP05.phx.gbl...
> Bob Barrows wrote:
>>
>> 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.
>
> --
> HTH,
> Bob Barrows
>
>
Author
8 May 2009 4:24 PM
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.
fniles wrote:
Show quoteHide quote
> Do you suggest me checking if the
> request.servervariables("logon_user") has permission to the file I am
> trying to access ?
>
> Thank you.
>
> "Bob Barrows" <reb01501@NOyahoo.SPAMcom> wrote in message
> news:%23LBk99%23zJHA.4736@TK2MSFTNGP05.phx.gbl...
>> Bob Barrows wrote:
>>>
>>> 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.
>>
>> --
>> HTH,
>> Bob Barrows

--
HTH,
Bob Barrows
Author
8 May 2009 4:12 PM
Adrienne Boswell
Gazing into my crystal ball I observed "Bob Barrows" <reb01501
Show quoteHide quote
@NOyahoo.SPAMcom> writing in news:#AQbm6#zJHA.4800@TK2MSFTNGP06.phx.gbl:

>>> 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.
>>
> 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.

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
Author
8 May 2009 4:14 PM
Bob Barrows
Adrienne Boswell wrote:
Show quoteHide quote
> Gazing into my crystal ball I observed "Bob Barrows" <reb01501
> @NOyahoo.SPAMcom> writing in
> news:#AQbm6#zJHA.4800@TK2MSFTNGP06.phx.gbl:
>
>>>> 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.
>>>
>> 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.
>
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.


--
HTH,
Bob Barrows
Author
8 May 2009 3:16 PM
Bob Barrows
Roberto Franceschetti wrote:
> If you're using "Integrated Windows Authentication" in the Directory
> Security tab under authentication methods, this only allows IIS to
> have a security token that grants authenticated users to resources
> local on the IIS server itself, they won't have network access.

I don't think that is true. You may need to read this:
http://databases.aspfaq.com/database/why-can-t-i-access-a-database-or-text-file-on-another-server.html

--
HTH,
Bob Barrows
Author
8 May 2009 3:18 PM
Bob Barrows
Bob Barrows wrote:
> Roberto Franceschetti wrote:
>> If you're using "Integrated Windows Authentication" in the Directory
>> Security tab under authentication methods, this only allows IIS to
>> have a security token that grants authenticated users to resources
>> local on the IIS server itself, they won't have network access.
>
> I don't think that is true. You may need to read this:
>
http://databases.aspfaq.com/database/why-can-t-i-access-a-database-or-text-file-on-another-server.html
>
Oh wait - I misread your reply - what you said was true
--
HTH,
Bob Barrows

Bookmark and Share