RE: Impersonate
- From: stcheng@xxxxxxxxxxxxxxxxxxxx (Steven Cheng[MSFT])
- Date: Tue, 12 Feb 2008 03:40:30 GMT
Thanks for your reply Zino,
As you mentioned:
===================
There is a common function (accessible to any user) that extract a value
from a sql table, and stream it as Excel file to the user.
===================
so the excel files are stored as binary content in the database? If so, is
it doable here that you directory transfer the binary content to the target
user. Also, what's y our current code that stream out the excel file? For
ASP.NET page, I know that you can directly write out binary content into
page's response stream instead of through a physical file on disk. For
example:
==========
Response.Clear();
Response.ContentType = "application/pdf";
Response.BinaryWrite( byte array here...)
Response.End()
==========
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: =?Utf-8?B?emlubw==?= <zino@xxxxxxxxxxxxxxx><es#HrSGbIHA.4200@xxxxxxxxxxxxxxxxxxxxxx>
References: <30967082-2D83-4191-8123-B4D29E5F0ECE@xxxxxxxxxxxxx>
Subject: RE: Impersonate
Date: Mon, 11 Feb 2008 14:29:18 -0800
Hi Steven,save
I solved it by placing the "if myImpersonate.StartImpersonation" statement
at the begining of the function, instead of waiting until the
"workbook.SaveAs"
as:
function SaveExcel(filePath As String) As Boolean
if myImpersonate.StartImpersonation then
dim xl As Excel.Application
dim wb As Excel.Workbook
... .. .. .
workbook.saveAs(.. . ..
The application need to capture the logged user NT domain account to
compare it against a one saved in a back end SQL database.
The user must have an NT domain account + must be registered within the
application in order to use it.
There is a common function (accessible to any user) that extract a value
from a sql table, and stream it as Excel file to the user.
I don't know how to stream the Excel file without saving it first on the
hard drive, therfore I created an account that have write permissions to
the Excel file.
instead of assigning this WRITE permissions to every user.
and that's why you see Windows Authentication and impersonate=true are
enabled. In fact the authentication type is kind of Form Authentication.
How can I stream excel without saving it first on the hard drive ?
.
- References:
- Impersonate
- From: zino
- RE: Impersonate
- From: Steven Cheng[MSFT]
- Impersonate
- Prev by Date: Adding Roles and Membership to 2003
- Next by Date: Re: Allow certain users for an intranet app
- Previous by thread: RE: Impersonate
- Next by thread: RE: Impersonate
- Index(es):
Relevant Pages
|
|