RE: Impersonate



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>
References: <30967082-2D83-4191-8123-B4D29E5F0ECE@xxxxxxxxxxxxx>
<es#HrSGbIHA.4200@xxxxxxxxxxxxxxxxxxxxxx>
Subject: RE: Impersonate
Date: Mon, 11 Feb 2008 14:29:18 -0800

Hi Steven,

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
save
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 ?






.



Relevant Pages

  • Re: start client excel application from web
    ... dynamically create the Excel file, load it with data, then stream it to the ... the tough part is generating an Excel file dynamically. ... can you use a server side component instead? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Event service attachments
    ... The bottomline of my goal is to read in an excel file send to a certain ... My first problem is how to read in the excel file without having to ... save it to disk. ... stream and read into that stream. ...
    (microsoft.public.exchange.admin)
  • event service - attachment in stream
    ... The bottomline of my goal is to read in an excel file send to a certain ... My first problem is how to read in the excel file without having to ... save it to disk. ... stream and read from that stream. ...
    (microsoft.public.exchange.development)
  • Re: Binary Stream Excel Client Problem
    ... Do you send an Excel File? ... Or just a csv file in the stream? ... sure where to clock is set. ... You could change the filename everytime, ...
    (microsoft.public.dotnet.framework.aspnet)