4.26. Enabling Web Sharing

Problem

You want to enable web sharing for a folder. This allows users from non-Windows-based PCs to view the contents of a share using the web.

Solution

Using a graphical user interface

  1. Open Windows Explorer.

  2. In the left pane, browse to the folder you want to share.

  3. Right-click on the folder and select Sharing and Security (or Sharing on Windows 2000).

  4. Select the Web Sharing tab.

  5. Select Share this folder.

  6. A dialog box appears with the settings you can configure for the web share. Click OK when you are done.

  7. Click OK to close the dialog box.

Discussion

To use Web Sharing, you must have IIS installed and running. When you create a web share, you are doing nothing more than creating a virtual directory in IIS. See Recipe 12.5 for more on virtual directories.

The security for a web share is a little different from a regular share: you have to select the access permissions and application permissions you want to use. Here is a list of access permissions:

Read

Allows web users to read files in the folder

Write

Allows web users to write files in the folder

Script source access

Allows web users to view the source code of scripts in the folder

Directory browsing

Allows web users to browse the folder contents

And here are the application permissions:

None

Does not allow the execution of scripts or programs

Scripts

Allows the execution of scripts, but not programs

Execute

Allows the execution of both scripts and programs

Keep in mind that NTFS and Web server permissions also apply to web shares. If the user is accessing the share without authenticating, the permissions will be based on the IUSR account IIS is running under (normally IUSER_<computername>). If the user authenticates, permissions will based on his or her credentials.

See Also

Recipe 12.4

Get Windows Server Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.