Skip to content

Instantly share code, notes, and snippets.

@glebov21
Last active September 9, 2021 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save glebov21/a311013dba1d83b8076bee2339dabf79 to your computer and use it in GitHub Desktop.
Save glebov21/a311013dba1d83b8076bee2339dabf79 to your computer and use it in GitHub Desktop.
Allow to download all files from iis folder (applicationHost.config -> allowSubDirConfig="false")
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<location path="ForDownload" allowOverride="false" inheritInChildApplications="false">
<system.webServer>
<security>
<authorization>
<!-- Allow all users access to the Public folder -->
<remove users="*" roles="" verbs="" />
<add accessType="Allow" users="*" roles="" />
</authorization>
<requestFiltering>
<hiddenSegments>
<clear />
</hiddenSegments>
<fileExtensions>
<clear />
</fileExtensions>
</requestFiltering>
</security>
<directoryBrowse enabled="true" />
<defaultDocument>
<files>
<!-- When requesting a file listing, don't serve up the default
index.html file if it exists. -->
<clear />
</files>
</defaultDocument>
<handlers>
<clear />
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule" resourceType="Either" requireAccess="Read" />
</handlers>
<!-- Map all extensions to the same MIME type, so all files can be
downloaded. -->
<staticContent>
<clear />
<mimeMap fileExtension="*" mimeType="application/octet-stream" />
</staticContent>
</system.webServer>
</location>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment