473,396 Members | 1,879 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 1867
"=?Utf-8?B?V2lsbGlhbSBTdWxsaXZhbg==?="
<Wi*************@discussions.microsoft.com> wrote in
news:B6**********************************@microsof t.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********@rogers.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?V2lsbGlhbSBTdWxsaXZhbg==?="
<Wi*************@discussions.microsoft.com> wrote in
news:B6**********************************@microsof t.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.microsoft.com> wrote in message
news:5D**********************************@microsof t.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?V2lsbGlhbSBTdWxsaXZhbg==?="
<Wi*************@discussions.microsoft.com> wrote in
news:B6**********************************@microsof t.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.microsoft.com> wrote in
message news:5D**********************************@microsof t.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?V2lsbGlhbSBTdWxsaXZhbg==?="
<Wi*************@discussions.microsoft.com> wrote in
news:B6**********************************@microsof t.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
by: Zenobia | last post by:
I copy an application to wwwroot: wwwroot +--- myApp +--- common | +--- images | default.asp global.asa
2
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...
4
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...
5
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...
10
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...
4
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...
2
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...
6
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...
6
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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
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...
0
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,...

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.