Setting up IIS to allow download of EXE and ZIP files

By Alan S. at July 23, 2010 02:45
Filed Under: General, Web / Software Development

Before IIS7, the main method for allowing users to download files of a protected type (exe, zip, etc.) meant writing a function based off the Stream method and writing the file out based on individual name. Thankfully with IIS7+ there is a much easier way.

 

First, I would recommend that all files meant for internet user download be maintained in a separate virtual directory. For example, if your site was called www.mysite.com, the downloadable files should be in a directory like www.mysite.com/userdownloads. Once the files are in place, you need to do the following:

 

1)  Open the IIS 7.0 (or later) Manager on the server

2)  Select the site and click on "Handler Mappings"

3)  Select "Add Module Mapping"

4)  Enter the fields on the window:

     a)  Request Path:   where are the files to be found don't put a leading slash.  Example: "userdownloads/*.exe" to allow all files in the userdownloads directory ending in .exe to be downloaded when the request is for any executable file within the virtual path that you would have defined earlier.

     b)  Module:  StaticFileModule - this will handle requests containing your request path and return the file to you.

     c)  Executable:  don't enter anything.

     d)  Name:  whatever you want to call it:  "ClientSide Executables"

5)  Click on "Request Restrictions" and click on the checkbox and ensure that "File" option is selected.  (This will only apply to files)

6)  Click on the "Access" tab.  Ensure that "Script" is selected.

7)  Click on "OK" to close this window

8)  Click on "OK" to close the main Handler screen.

9)  Your handler should now appear in the list with the other handlers. 

10)  Test it out by opening a browser and accessing an executable file.

Bookmark and Share DotnetKicks dotnetshoutout

Comments

7/23/2010 2:48:53 AM #

trackback

Setting up IIS to allow download of EXE and ZIP files

You've been kicked (a good thing) - Trackback from DotNetKicks.com

DotNetKicks.com | Reply

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading




   

eMail Scraper
Generate email lists in seconds!


eSource Development presents the ultimate tool for email lead generation! They have decided to release the hottest email list generation tool that allows you to get hundreds (even THOUSANDS) of specific email addresses for any genre, niche, or geographical area.

Internet marketing companies and professionals have been using this tool for years. Now, it has been re-engineered, updated, and released to the public. This 'insider only' software was a closely guarded industry secret until recently.



Watch the Demo

NEW! Trial version available!

DOWNLOAD FOR FREE




  


Dr. Torgo's PC
System Inventory v2.0


Dr. Torgo's PC System Inventory offers a full range of system query options and powerful reporting tools. This software quickly generates reports on several dozen hives of system information including disks, CPU, memory, motherboard, users, ports, services, software, and MORE.

Read more here!

NEW! Trial version available!
DOWNLOAD FOR FREE


Help us out by visiting our sponsors!

Go Daddy $7.49 .com sale







Recent Comments

Comment RSS

What We're Playing





Who's Watchin' Me?