O
Oleg Ogurok
Hi all,
I have a ASP.NET app that uses Excel interop to save an .xls file on disk in
a temp folder and then read it back and e-mails it as an attachment.
The problem is deciding where to store the temp file. My web.config has
<identity impersonate="true" />
When I call System.IO.Path.GetTempPath(), it returns
C:\DOCUME~1\MYSERVER\ASPNET\LOCALS~1\Temp. However, when I try to save the
file, I get an error saying "Microsoft Office Excel cannot access the file."
It seems despite the impersonation, I still get the home dir of ASPNET user
instead of the user under which the IIS virtual directory is running. Is
there a more correct way of getting a temp path?
Thanks.
-Oleg.
I have a ASP.NET app that uses Excel interop to save an .xls file on disk in
a temp folder and then read it back and e-mails it as an attachment.
The problem is deciding where to store the temp file. My web.config has
<identity impersonate="true" />
When I call System.IO.Path.GetTempPath(), it returns
C:\DOCUME~1\MYSERVER\ASPNET\LOCALS~1\Temp. However, when I try to save the
file, I get an error saying "Microsoft Office Excel cannot access the file."
It seems despite the impersonation, I still get the home dir of ASPNET user
instead of the user under which the IIS virtual directory is running. Is
there a more correct way of getting a temp path?
Thanks.
-Oleg.