469,963 Members | 1,282 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,963 developers. It's quick & easy.

\\UNC and ASP

I have two servers. One contains the ASP web application (\\Server1) and
the other contains the data files (\\Server2).

I'm having some problem with the following "file download" code at line
"adoStream.LoadFromFile(FPath)".

The error is "ADODB.Stream error '800a0bba' / File could not be opened."

Could someone please offer some suggestions?
<%
Response.Buffer = False
Server.ScriptTimeout = 30000
Response.ContentType = "application/x-unknown" ' arbitrary

fn = "MyPhoto.jpg"
fpath = "\\Server2\g$\files\MyPhoto.jpg"

Response.AddHeader "Content-Disposition", "attachment; filename=" & fn
Set adoStream = CreateObject("ADODB.Stream")
chunk = 2048

adoStream.Open()
adoStream.Type = 1
adoStream.LoadFromFile(FPath)
iSz = adoStream.Size
Response.AddHeader "Content-Length", iSz
For i = 1 To iSz \ chunk
If Not Response.IsClientConnected Then Exit For
Response.BinaryWrite adoStream.Read(chunk)
Next

If iSz Mod chunk 0 Then
If Response.IsClientConnected Then
Response.BinaryWrite adoStream.Read(iSz Mod chunk)
End If
End If

adoStream.Close
Set adoStream = Nothing
Response.End
%>
Aug 14 '06 #1
7 6920

"David R." <da***********@nospam.comwrote in message
news:eI**************@TK2MSFTNGP04.phx.gbl...
>I have two servers. One contains the ASP web application (\\Server1) and
the other contains the data files (\\Server2).

I'm having some problem with the following "file download" code at line
"adoStream.LoadFromFile(FPath)".

The error is "ADODB.Stream error '800a0bba' / File could not be opened."

Could someone please offer some suggestions?
<%
Response.Buffer = False
Server.ScriptTimeout = 30000
Response.ContentType = "application/x-unknown" ' arbitrary

fn = "MyPhoto.jpg"
fpath = "\\Server2\g$\files\MyPhoto.jpg"

This only works, if the anonymous user account IUSR_ has access rights over
the network, and by default, it has not.

Aug 14 '06 #2
Could you please tell me how to set that up?

Thank you.
"Egbert Nierop (MVP for IIS)" <eg***********@nospam.invalidwrote in
message news:Ow**************@TK2MSFTNGP06.phx.gbl...
>
"David R." <da***********@nospam.comwrote in message
news:eI**************@TK2MSFTNGP04.phx.gbl...
>>I have two servers. One contains the ASP web application (\\Server1) and
the other contains the data files (\\Server2).

I'm having some problem with the following "file download" code at line
"adoStream.LoadFromFile(FPath)".

The error is "ADODB.Stream error '800a0bba' / File could not be opened."

Could someone please offer some suggestions?
<%
Response.Buffer = False
Server.ScriptTimeout = 30000
Response.ContentType = "application/x-unknown" ' arbitrary

fn = "MyPhoto.jpg"
fpath = "\\Server2\g$\files\MyPhoto.jpg"


This only works, if the anonymous user account IUSR_ has access rights
over the network, and by default, it has not.

Aug 14 '06 #3
http://www.aspfaq.com/show.asp?id=2168
David R. wrote:
Could you please tell me how to set that up?

Thank you.
"Egbert Nierop (MVP for IIS)" <eg***********@nospam.invalidwrote in
message news:Ow**************@TK2MSFTNGP06.phx.gbl...
>>
"David R." <da***********@nospam.comwrote in message
news:eI**************@TK2MSFTNGP04.phx.gbl...
>>I have two servers. One contains the ASP web application
(\\Server1) and the other contains the data files (\\Server2).

I'm having some problem with the following "file download" code at
line "adoStream.LoadFromFile(FPath)".

The error is "ADODB.Stream error '800a0bba' / File could not be
opened."

Could someone please offer some suggestions?
<%
Response.Buffer = False
Server.ScriptTimeout = 30000
Response.ContentType = "application/x-unknown" ' arbitrary

fn = "MyPhoto.jpg"
fpath = "\\Server2\g$\files\MyPhoto.jpg"


This only works, if the anonymous user account IUSR_ has access
rights over the network, and by default, it has not.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Aug 14 '06 #4
I recreated the IUSR/IWAM accounts reset/resynced passwords on the remote
server and gave them Full Control (figuring it was permissions thing).

However this did not fix it and I still receive the same message.

Here are my questions
1. What permissions are need for the ADODB.Stream to read a remote
filesystem (ie., what security context is it currently running under, please
don't say SYSTEM)?

2. If this is not possible are there any alternatives to the ADODB.Stream to
download a file from a remote filesystem?

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcomwrote in message
news:e3*************@TK2MSFTNGP05.phx.gbl...
http://www.aspfaq.com/show.asp?id=2168
David R. wrote:
>Could you please tell me how to set that up?

Thank you.
"Egbert Nierop (MVP for IIS)" <eg***********@nospam.invalidwrote in
message news:Ow**************@TK2MSFTNGP06.phx.gbl...
>>>
"David R." <da***********@nospam.comwrote in message
news:eI**************@TK2MSFTNGP04.phx.gbl...
I have two servers. One contains the ASP web application
(\\Server1) and the other contains the data files (\\Server2).

I'm having some problem with the following "file download" code at
line "adoStream.LoadFromFile(FPath)".

The error is "ADODB.Stream error '800a0bba' / File could not be
opened."

Could someone please offer some suggestions?
<%
Response.Buffer = False
Server.ScriptTimeout = 30000
Response.ContentType = "application/x-unknown" ' arbitrary

fn = "MyPhoto.jpg"
fpath = "\\Server2\g$\files\MyPhoto.jpg"
This only works, if the anonymous user account IUSR_ has access
rights over the network, and by default, it has not.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


Aug 14 '06 #5

"David R." <da***********@nospam.comwrote in message
news:Ox****************@TK2MSFTNGP05.phx.gbl...
>I recreated the IUSR/IWAM accounts reset/resynced passwords on the remote
server and gave them Full Control (figuring it was permissions thing).

However this did not fix it and I still receive the same message.

Here are my questions
1. What permissions are need for the ADODB.Stream to read a remote
filesystem (ie., what security context is it currently running under,
please don't say SYSTEM)?

2. If this is not possible are there any alternatives to the ADODB.Stream
to download a file from a remote filesystem?
What he means that you reconfigure IUSR account.

Create a network user account, that is not a 'guest' member.
Then apply that user to the anonymous account, and make sure that the
\\SERVER\SHARE also allows that user and the NTFS permission on that remote
file system allows that user.

Aug 15 '06 #6
So, on \\Server1, I would change the password for Server1\IUSR_Server1 in
IIS.

Then on \\Server2, I would create Server2\IUSR_Server1 account with the same
password.

Is this correct?
"Egbert Nierop (MVP for IIS)" <eg***********@nospam.invalidwrote in
message news:ez**************@TK2MSFTNGP06.phx.gbl...
>
"David R." <da***********@nospam.comwrote in message
news:Ox****************@TK2MSFTNGP05.phx.gbl...
>>I recreated the IUSR/IWAM accounts reset/resynced passwords on the remote
server and gave them Full Control (figuring it was permissions thing).

However this did not fix it and I still receive the same message.

Here are my questions
1. What permissions are need for the ADODB.Stream to read a remote
filesystem (ie., what security context is it currently running under,
please don't say SYSTEM)?

2. If this is not possible are there any alternatives to the ADODB.Stream
to download a file from a remote filesystem?

What he means that you reconfigure IUSR account.

Create a network user account, that is not a 'guest' member.
Then apply that user to the anonymous account, and make sure that the
\\SERVER\SHARE also allows that user and the NTFS permission on that
remote file system allows that user.

Aug 15 '06 #7

"David R." <da***********@nospam.comwrote in message
news:u1*************@TK2MSFTNGP05.phx.gbl...
So, on \\Server1, I would change the password for Server1\IUSR_Server1 in
IIS.

Then on \\Server2, I would create Server2\IUSR_Server1 account with the
same password.

Is this correct?
No, since IUSR_ blah has no access rights on the network share.

Just create DOMAIN\IUSR_blah

and on both IIS servers, you configure these accounts, by applying them.

These accounts, must be user accounts. It's a penalty in security so be
aware of that.

Aug 15 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Tim Black | last post: by
1 post views Thread by Erik Lindeblom | last post: by
4 posts views Thread by flipdoubt | last post: by
7 posts views Thread by Tim Marsden | last post: by
reply views Thread by mcrose | last post: by
3 posts views Thread by wreed | last post: by
1 post views Thread by rainxy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.