473,662 Members | 2,622 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reading and writing to a virtual directory

I have an application that pulls images from a physical drive directory,
creates a PDF of the image, caches the image, and returns a link to the
client (using ajax, but that's not the problem). I'm faced with having to do
this without knowing where this PDF cache location is. It may be on the
local drive, or it may be on a network share. What I'd like to do is have
the client add a Virtual Directory in IIS under the project web directory
that points to this cache, and then access this cache through IIS. Is this
possible? Would I be able to read and write to this (assuming the correct
security settings are added in IIS) using a relative path such as
"~/cachename/file.pdf"? Would I still have to give the ASPNET account rights
to this path, or impersonate someone with the correct rights? And are there
any resources on the web about reading/writing to virtual directories in
ASP.NET applications? TIA!
Nov 19 '05 #1
4 1886
"=?Utf-8?B?V2lsbGlhbSB TdWxsaXZhbg==?= "
<Wi************ *@discussions.m icrosoft.com> wrote in
news:B6******** *************** ***********@mic rosoft.com:
Would I be
able to read and write to this (assuming the correct security settings
are added in IIS) using a relative path such as
"~/cachename/file.pdf"?
Use Server.MapPath to get the physical directory name.

Would I still have to give the ASPNET account rights to this path, or impersonate someone with the correct rights?
And are there any resources on the web about reading/writing to
virtual directories in ASP.NET applications? TIA!


Yes, I believe ASPNET will need read/write access.

--
Lucas Tam (RE********@rog ers.com)
Please delete "REMOVE" from the e-mail address when replying.

Newmarket Volvo Sucks! http://newmarketvolvo.tripod.com
Nov 19 '05 #2
I tested this, and it appears to fail when the virtual directory points to a
network share. Any other ideas?

"Lucas Tam" wrote:
"=?Utf-8?B?V2lsbGlhbSB TdWxsaXZhbg==?= "
<Wi************ *@discussions.m icrosoft.com> wrote in
news:B6******** *************** ***********@mic rosoft.com:
Would I be
able to read and write to this (assuming the correct security settings
are added in IIS) using a relative path such as
"~/cachename/file.pdf"?


Use Server.MapPath to get the physical directory name.

Would I still have to give the ASPNET account
rights to this path, or impersonate someone with the correct rights?
And are there any resources on the web about reading/writing to
virtual directories in ASP.NET applications? TIA!


Yes, I believe ASPNET will need read/write access.

Nov 19 '05 #3
re:
I tested this, and it appears to fail when the
virtual directory points to a network share.
That's because the asp.net account needs permisions
to the network share, and that has nothing to do with
the permissions for the local file system.

Make sure the network share allows access
to the server's asp.net account.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
=============== =============== ========
"William Sullivan" <Wi************ *@discussions.m icrosoft.com> wrote in message
news:5D******** *************** ***********@mic rosoft.com...I tested this, and it appears to fail when the virtual directory points to a
network share. Any other ideas?

"Lucas Tam" wrote:
"=?Utf-8?B?V2lsbGlhbSB TdWxsaXZhbg==?= "
<Wi************ *@discussions.m icrosoft.com> wrote in
news:B6******** *************** ***********@mic rosoft.com:
> Would I be
> able to read and write to this (assuming the correct security settings
> are added in IIS) using a relative path such as
> "~/cachename/file.pdf"?


Use Server.MapPath to get the physical directory name.

Would I still have to give the ASPNET account
> rights to this path, or impersonate someone with the correct rights?
> And are there any resources on the web about reading/writing to
> virtual directories in ASP.NET applications? TIA!


Yes, I believe ASPNET will need read/write access.

Nov 19 '05 #4
to read/write to a network share require the asp.net account run as a domain
account.

for 2003, turn off impersonation and use an appool with a domain account
with permissions to the share.
for 2000, you need to impersonate a domain/account

-- bruce (sqlwork.com)

"William Sullivan" <Wi************ *@discussions.m icrosoft.com> wrote in
message news:5D******** *************** ***********@mic rosoft.com...
I tested this, and it appears to fail when the virtual directory points to
a
network share. Any other ideas?

"Lucas Tam" wrote:
"=?Utf-8?B?V2lsbGlhbSB TdWxsaXZhbg==?= "
<Wi************ *@discussions.m icrosoft.com> wrote in
news:B6******** *************** ***********@mic rosoft.com:
> Would I be
> able to read and write to this (assuming the correct security settings
> are added in IIS) using a relative path such as
> "~/cachename/file.pdf"?


Use Server.MapPath to get the physical directory name.

Would I still have to give the ASPNET account
> rights to this path, or impersonate someone with the correct rights?
> And are there any resources on the web about reading/writing to
> virtual directories in ASP.NET applications? TIA!


Yes, I believe ASPNET will need read/write access.

Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
13352
by: Zenobia | last post by:
I copy an application to wwwroot: wwwroot +--- myApp +--- common | +--- images | default.asp global.asa
2
4221
by: Jeffry van de Vuurst | last post by:
Hi, (sorry for the crosspost, I wasn't sure which was the best place to put this). I was just thinking about something and wondered if any of you has some ideas about this. I'm using the NetAdvantage component suite from Infragistics for my web applications. When installing they create several virtual
4
2590
by: Michelle | last post by:
I have a website with 6 virtual directories under it who dont "see" the bin/ directory in the root. If I create a /bin directory in each virtual directory and then copy my dll's in there, it works. Any idea what I'm doing wrong? Or any other way to reference a dll? I know a solution is to copy the dll's into the GAC, but this server has many other websites running on it, so I don't want the dll's there and available to any other...
5
3665
by: Leszek | last post by:
Hello, Could anybody explain what's a difference between a virtual directory and an application root under IIS? I'm a little bit confused. This is mu problem: Let's assume the following directory structure: FileManager (application name a.k.a. virtual directory?)
10
3641
by: Wm. Scott Miller | last post by:
We have a intranet site that allows one of our departments to search a set of pdfs and then look at them. Only problem is that only they and us geeks should be allowed to see the pdfs. We have it locked down except for when a person directly types in the url to a pdf. Currently, the PDFs are in a virtual directory off the root of the server. Putting it under the search site also doesn't work. My understanding is that IIS looks as the...
4
2941
by: david | last post by:
I basically use the following code to display the directory and file names in the WWWROOT, but can not show the virtual directory. ---- Dim path As String = Server.MapPath(x) Dim di As DirectoryInfo = New DirectoryInfo(path) Listing.DataSource = di.GetFileSystemInfos() Listing.DataBind() ---- Anyone can help me about how to list the virtual directory.
2
2606
by: BLetts | last post by:
I have an ASP.NET app that must allow users to upload files. The files are stored in a virtual directory. I use Server.MapPath to map from the virtual directory name to a physical path, then the FileUpload control SaveAs method to upload and save the file. This all works fine when the virtual directory points to a local drive on the ASP.NET server. However, when pointing to a remote drive (which is what my client wants to do), I get...
6
4337
by: ManagedCoder | last post by:
Hi, My requirement is as follows: I need to set the HttpExpires (enable content expiration - set to 7 days) on a folder within a virtual directory. I have been able to set the HttpExpires property on a virtual directory using the following code: DirectoryEntry myVdPath = new
6
3517
by: Scott M. | last post by:
I didn't get a resolution to this in my earlier post, so I'll try again: System: Windows XP Pro. (SP2) with IIS installed and running PRIOR to VS 2008 Pro. installation. VS 2008 Pro. (full installation). Installations and testing is all done via an Administrator account. If I simply create a new ASP .NET Web Application Project (WAP) on my local
0
8432
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8857
Oralloy
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...
0
8633
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7367
agi2029
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...
1
6186
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 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...
0
5654
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();...
0
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2762
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 we have to send another system
2
1752
bsmnconsultancy
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...

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.