Hi. I have a virtual path setup in order to give my web server access
to a file on my app server. I am using the file system object to check
for the existance of the file and if it exists, it has to validate the
file date.
The problem is I can't seem to find the file. I can successfully check
for the existance of a file on the web server, but once I enter the
virtual path it can't find anything. All three of these calls return
false...
fso.FileExists( "http://server/localfolder/virtualfolder/test.txt")
fso.FileExists( "/localfolder/virtualfolder/test.txt")
fso.FileExists( Server.MapPath( "/localfolder/virtualfolder/test.txt"))
However these two calls work, so I assume I am referencing the file
correctly...
Response.Redire ct "http://server/localfolder/virtualfolder/test.txt"
Response.Redire ct "/localfolder/virtualfolder/test.txt"
Am I doing something wrong here? The virtual path is setup with an id
that has full access to the folder.
Thanks. 5 6942 mb******@hotmai l.com wrote: fso.FileExists( "http://server/localfolder/virtualfolder/test.txt") fso.FileExists( "/localfolder/virtualfolder/test.txt") fso.FileExists( Server.MapPath( "/localfolder/virtualfolder/test.txt"))
This is the only one that should work. FileSystemObjec ts need a file-system
paths, not urls. Server.MapPath returns a file-system path. However these two calls work, so I assume I am referencing the file correctly...
Response.Redire ct "http://server/localfolder/virtualfolder/test.txt" Response.Redire ct "/localfolder/virtualfolder/test.txt"
Why didn't you test this?
Response.Write Server.MapPath( "/localfolder/virtualfolder/test.txt")
Does that display the correct file-system path? Am I doing something wrong here? The virtual path is setup with an id that has full access to the folder.
If the correct file-system path is displayed, then there is a permissions
problem.
If your website has Anonymous access enabled, then the IUSR and IWAM
accounts require access to the folder. It is those accounts that asp code
run under when Anounymous is used (unless another account was configured to
be used ).
Otherwise, the users of your site need access.
Bob Barrows
--
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.
Thanks Bob. Yes, Response.Write
Server.MapPath( "/localfolder/virtualfolder/test.txt") returns the
correct physical path. I will look into getting the IUSR and IWAM
accounts access to the app server. I just need to create accounts
using the same id/password on the app server, correct?
I guess I was thrown off track because when I created the virtual
folder it prompted me to enter a id/password. I entered one that does
have rights to the app server, therefore I thought this would take care
of all the permissions. If this id is not used when accessing the app
server, then what is it for?
Thanks. mb******@hotmai l.com wrote: Thanks Bob. Yes, Response.Write Server.MapPath( "/localfolder/virtualfolder/test.txt") returns the correct physical path. I will look into getting the IUSR and IWAM accounts access to the app server. I just need to create accounts using the same id/password on the app server, correct?
No, they should already be there if IIS is installed.
I guess I was thrown off track because when I created the virtual folder it prompted me to enter a id/password.
What tool did you use to create this virtual directory?
I entered one that does have rights to the app server, therefore I thought this would take care of all the permissions. If this id is not used when accessing the app server, then what is it for?
I'm not sure - I was never prompted for a id/password when creating a
virtual folder.
--
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.
IIS is installed on the web server, but not the app server. I thought
what you were saying is I need to create the same accounts on the app
server, or did I misinterpret?
I created the virtual directory within IIS. It first asked me for an
alias, then a path. When you put in the path of a different server, it
presents a screen that says...
Security Credentials
Enter the user name and password that should be used to gain access to
the network directory.
By default the following is checked: Always use the authenticated
user's credentials when validating access to the network directory.
I unchecked this and entered an id/password that I know has access to
the folder on the app server (the one the virtual directory is pointing
to).
Thanks.
Bob Barrows [MVP] wrote: mb******@hotmai l.com wrote: Thanks Bob. Yes, Response.Write Server.MapPath( "/localfolder/virtualfolder/test.txt") returns the correct physical path. I will look into getting the IUSR and IWAM accounts access to the app server. I just need to create accounts using the same id/password on the app server, correct?
No, they should already be there if IIS is installed.
I guess I was thrown off track because when I created the virtual folder it prompted me to enter a id/password.
What tool did you use to create this virtual directory?
I entered one that does have rights to the app server, therefore I thought this would take care of all the permissions. If this id is not used when accessing the app server, then what is it for? I'm not sure - I was never prompted for a id/password when creating a virtual folder.
-- 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. mb******@hotmai l.com wrote: IIS is installed on the web server, but not the app server. I thought what you were saying is I need to create the same accounts on the app server, or did I misinterpret?
I created the virtual directory within IIS. It first asked me for an alias, then a path. When you put in the path of a different server, it presents a screen that says...
Security Credentials Enter the user name and password that should be used to gain access to the network directory.
By default the following is checked: Always use the authenticated user's credentials when validating access to the network directory.
I unchecked this and entered an id/password that I know has access to the folder on the app server (the one the virtual directory is pointing to).
Thanks.
There are still filesytem permissions to worry about. see this article: http://www.aspfaq.com/show.asp?id=2168
--
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. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Bennie |
last post by:
Hi,
I have a problem with ZipFile.
It works okay untily I come across a file that is greater then 1Gb.
Then it exit with the error:
OverflowError: long int too large to convert to int
How can I fix this?
souce:
|
by: Joe Laughlin |
last post by:
I've not used C much before, so I don't know how robust or good this code
is. I'd appreciate any feedback or criticisms anyone has!
Thanks,
Joe
#include <stdio.h>
#include <string.h>
|
by: Sky Sigal |
last post by:
I have created an IHttpHandler that waits for uploads as attachments for a
webmail interface, and saves it to a directory that is defined in
config.xml.
My question is the following:
assuming that this is suppossed to end up as a component for others to use,
and therefore I do NOT have access to their global.cs::Session_End()
how do I cleanup files that were uploaded -- but obviously left stranded
when the users aborted/gave up writting...
|
by: DC Gringo |
last post by:
How do I test for existence of a file in the file system:
If FileExists(myVariable & ".pdf") = True
pnlMyPanel.Visible = True
End If
--
_____
DC G
|
by: Niggy |
last post by:
I am trying to load a file from a dropdownlist, however I get a error saying
a virtual path is required. An example selected value would be
"../4900/myfile.doc". Any ideas - my code is.
Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = sumfin.Substring(3, pos - 3)
Dim cString As String = "http://localhost/" & bString
Server.Transfer(cString)
| |
by: ptass |
last post by:
Hi
In asp.net 2.0 an aspx files .cs file is a partial class and all works fine,
however,
I thought I’d be able to create another class file, call it a partial class
and have
that compile and load as a 3rd partial class. This would be handy so i can
generate
standard code into one of the partial classes, while having my custom code
untouched
|
by: Eugene Anthony |
last post by:
ds1.Tables.Rows.ItemArray.GetValue(0).ToString() contains the
string path: images/5/Video1/qbert.flv
if (File.Exists(ds1.Tables.Rows.ItemArray.GetValue(0).ToString()))
{
//code to execute
}
Despite the path exist along with the file name, the code never gets
executed.
|
by: dancer |
last post by:
Using ASP.net 1.1 and Microsoft Access.
I received the following error message. Why? I have closed the Access
file. I have another very small access file that opens with no trouble with
the same code, except a different name for the file.
The Microsoft Jet database engine cannot open the file
'C:\Inetpub\wwwroot\Accident.mdb'. It is already opened exclusively by
another user, or you need permission to view its data.
|
by: Steve |
last post by:
Hello-
Your assistance with this issue is greatly appreciated.
Environment:
- Load-balanced IIS 6.0 servers (Win2003)
- web servers point (via UNC path) to a Microsoft File Cluster on
different machines.
- domain ASPNET account that handles the function/permissions of the
(traditionally) local machine ASP.NET account.
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
| |
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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 then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |