Reading and writing to a virtual directory

G

Guest

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!
 
L

Lucas Tam

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.
 
G

Guest

I tested this, and it appears to fail when the virtual directory points to a
network share. Any other ideas?
 
J

Juan T. Llibre

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.
 
B

Bruce Barker

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top