Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9265257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:01:29+00:00 2026-06-18T14:01:29+00:00

First of all, I clear that I am using ASP.NET 4.5 with DefaultAppPool(integrated 4.0).

  • 0

First of all, I clear that I am using ASP.NET 4.5 with DefaultAppPool(integrated 4.0). I have also configured Anonymous Access to DefaultAppPool user. I have given all access to DefaultAppPool. System.Security.Principal.WindowsIdentity.GetCurrent() method give me the same user. But when the following line runs it gives me Access to the path 'XXXX' is denied. exception. Then for testing purpose, I have given all rights to EveryOne user but still getting the same error. Here is the line of code. Note the trus

        using (ZipArchive archive = new ZipArchive(zipStream))
        {
            foreach (ZipArchiveEntry file in archive.Entries)
            {
                file.ExtractToFile(location,true);
            }
        }

Here is the StackTrace,

[UnauthorizedAccessException: Access to the path 'XXX' is denied.]
   System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +10793558
   System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +1352
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) +65
   System.IO.Compression.ZipFileExtensions.ExtractToFile(ZipArchiveEntry source, String destinationFileName, Boolean overwrite) +96
   XX.XX.XX.ExtractZipFile(Stream zipStream, String location) in XX.cs:44
   XX.XX.XX.XX.XX.XX.ExtractZipFile(Stream zipStream, String location) in XXX.cs:17
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T14:01:30+00:00Added an answer on June 18, 2026 at 2:01 pm

    .NET framework in this case giving me the wrong exception. The problem was that, I was just passing location(folder location without file name). So after including complete path, this works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First of all, I'm using Windows, just to make that clear. I am using
First of all I am making it clear that, I am not using any
First of all, I want to be clear that I'm not talking about defining
First of all i have to clear few things 1.This is not spam group
I have an ASP.NET Web Form (C#) that users fill out, it has a
First of all, to be clear, I'm aware that a huge number of MD5
First of all, I want to make something clear before I get yelled at:
First of all, if the title of my question is not clear, please go
first of all some details: I configured security as below in web.xml view plaincopy
First of all sorry that I could not think of a more descriptive title.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.