I missed the beginning of this thread, why are you trying to
create an
instance of Excel on your server? Is it to get data from the
Workbook or
to put data into a workbook from an ASP.NET form (on
client)?
John Warner
> -----Original Message-----
> From: anoop [mailto:anoop.jaiswal mind-infotech.com]
> Sent: Wednesday, June 07, 2006 11:55 PM
> To: aspnet-admin aspadvice.com
> Subject: [aspnet-admin] RE:
SystemUnAuthorizedException:
> Access is denied.
>
>
> Thanks for the reply..........As per the security
matter I
> have added the users Adminstrators,Everyone,
internetusers
> and aspnets users with full control, but all in vein,
> whenever my server script trying to create the instance
of
> the excel application it throws an exception.
>
> The code what I have written is as below..........
>
>
> Function GetExcelData(strFileName as string)
>
> ---------------------
>
> If Not File.Exists(strFileName) Then
> GetExcelData = "N$File does not
exist : " &
> strFileName
> Exit Function
> End If
>
> objExcel =
CType(CreateObject("Excel.Application"),
> Excel.Application)
> objWorkbook =
CType(objExcel.Workbooks.Open(strFileName),
> Excel.Workbook)
> objSheet = CType(objWorkbook.Sheets(1),
Excel.Worksheet)
>
>
> ----------------------------------
> End function
>
> I didn't understand when there is no issue while
uploading
> the file in the folder then why an exception to
creating
> instance the excel application on the server itself to
read
> that file or is there another way to read the excel
file from
> server folder ??
>
> Thanks & Regards
>
> Anoop Jaiswal
> Soft. Engg.
> MothersonSumi INotech & Design Ltd.
> (A SEI CMM Level5 Company)
> B-7,Sector-7
> Noida,U.P.-201301
> Tel. No: +91-120-4365570
>
> -----Original Message-----
> From: Jason Cox [mailto:jcox coxinnovations.com]
> Sent: Wednesday, June 07, 2006 9:41 PM
> To: aspnet-admin aspadvice.com
> Subject: [aspnet-admin] RE:
SystemUnAuthorizedException:
> Access is denied.
>
> Anoop:
> The ASP.NET worker process runs under a certain
security
> context depending on a number of configuration
parameters. By
> default, it uses the local ASPNET account on the web
server
> for Win 2K and IIS 5 or the local IIS_WPG group for Win
2003
> and IIS 6. By default, the privileges given to this
> user/group is very restricted and thus is probably the
source
> of your permissions issue. You should explicitly grant
Read
> to the appropriate account or group on the folder on
the
> server where you're uploading the file to avoid the
> UnauthorizedException.
>
> Impersonation behaves differently because it actually
runs
> the ASP.NET requests under the account context of the
> currently logged-in interactive user. Of course, you
must
> have Anonymous auth turned off and Integrated auth
turned on
> in IIS (on the website, application or virtual
directory) for
> this to work but it means the resource you're
accessing (in
> this case, the Excel
> file) is coming in under the logged-in user's security
> context and not the ASPNET account or IIS_WPG group.
>
> If you configure the ACL correctly on your Excel upload
> folder then you should be able to turn impersonation
off on
> your web application. At least that's what I've seen
in my experience.
>
> Good luck!
>
> Jason
>
> ----- Original Message -----
> From: "anoop" <anoop.jaiswal mind-infotech.com>
> To: <aspnet-admin aspadvice.com>
> Sent: Wednesday, June 07, 2006 8:58 AM
> Subject: [aspnet-admin] SystemUnAuthorizedException:
Access is denied.
>
>
> > Hi All,
> >
> > I am new to web development and I am devloping a
web page
> using vs net
> 2003
> >
> > I had written a method and call it on my page
through java script.
> >
> > In the method I am creating new excel object to
read the uploaded
> > excel
> file
> > on the server, but it throws an error of
> SystemUnAuthorizedException:
> Access
> > is denied.
> >
> > The folder has all possible users and full access
to those users.
> >
> > but when I add <identity impersonation=true>
in my
> web.config file it
> works
> > fine on my system and return value also,
> > but with this setting when I run the page from
another user machine
> > the value return by the script is null.
> >
> > Is there any setting on server to read the
uploaded file on
> the server
> > folder?
> >
> > Thanks in advance for suggestions.
> >
> >
> >
> > Thanks & Regards
Need SQL Advice? http://sqladvice.com
Need RegEx Advice? http://regexadvice.com
Need XML Advice? http://xmladvice.com
|