473,503 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

\\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 7176

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3412
by: Tim Black | last post by:
In my recent experience, popen os pipes always fail when cwd is a UNC path. Can anyone shed any light on this? Although I've seen lots of UNC path-related problems in this newsgroup, I've not been...
1
1330
by: Erik Lindeblom | last post by:
I am having trouble getting ANY asp.net application (either .aspx or .asmx) working when IIS is configured to use a "share located on another computer" via a UNC reference. Any .aspx or .asmx...
2
2119
by: pj_servadmin | last post by:
Server Error in '/<applicationName>' Application -------------------------------------------------------------------------------- Parser Error Description: An error occurred during the parsing of...
4
1401
by: flipdoubt | last post by:
I have an application that stores paths as UNCs in a database. I want ASP.NET to move files from a UNC to a web accessible location, but I'm having the hardest time getting the app to access the...
7
19022
by: Tim Marsden | last post by:
Hi How do I determine the UNC path of a file in VB.NET. for example if I am given "D:\folder\file.txt", I want to obtain "\\Computer\Drive\Folder\file.txt" Tim
1
3978
by: Johan | last post by:
Hi all I'm trying to set the permissions of a file using WMI, and since i'm writing a windows service i want to use UNC paths doing this because the destination might not be a mapped path. I'we...
8
9699
by: Sarah | last post by:
I need to access some data on a server. I can access it directly using UNC (i.e. \\ComputerName\ShareName\Path\FileName) or using a mapped network drive resource (S:\Path\FileName). Here is my...
0
1500
by: mcrose | last post by:
I couldn't find anything that quite described this in whole, so I'm going to post it since from what I can tell about 400 other people have posted asking how to do this and received partial answers...
4
3095
by: DMG | last post by:
I have <identity impersonate = "true" /& <authentication mode="Windows"/in the web.config. This is a 2.0 site. My Goal: I want to simply have the user browse to a file on a mapped drive and get...
3
10043
by: wreed | last post by:
Is there a way on a button press to create a browse for a file box and then when they pick a file on a share drive to convert it to a UNC path and that way I would save the unc path into a table...
0
7188
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
6970
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7441
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4987
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4663
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3156
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3146
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1489
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
720
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.