BITS Server

The Background Intelligent Transfer Service (BITS) Server lets you configure an Internet Information Services (IIS) server to allow BITS clients to perform background, resumable file uploads to IIS virtual directories. Upon completion of a file upload, BITS Server can notify a Web application of the new file (via an HTTP POST to a configurable URL) in order to process the uploaded files. Your Web application can then optionally reply to the client's posting.

Other configurable options include: Limit setting on uploaded file size, automatic deletion of incomplete files after a preset amount of time, and server farm support.

  • Enable BITS Server

  • Customize BITS Server settings

  • Disable BITS Server Scripting


Enable BITS Server

The Background Intelligent Transfer Service (BITS) Server lets you configure an IIS server to allow BITS clients to perform background, resumable file uploads to IIS virtual directories. Upon completion of a file upload, BITS Server can notify a Web application of the new file (via a POST to a configurable URL) in order to process the uploaded files. Your Web application can then optionally reply to the client's posting.

To enable BITS Server

  1. Navigate to the virtual directory in the IIS Manager.

  2. From the features view of the virtual directory, double-click BITS Server.

  3. Select the Allow clients to upload files to this virtual directory check box.
Note

By default, BITS Server uses the settings from the parent Web site of the virtual directory. If these settings are not present, then BITS Server uses its default settings. You can change the behavior of BITS Server for the virtual directory by selecting the Customize Settings option.


Customize BITS Server settings

Use the BITS Server page to customize BITS Server settings for a specific virtual directory. You can configure file size limitations, notifications, cleanup frequency, and server farm support.

Upload job settings

The settings in this section allow you to configure the maximum size of uploaded files, when incomplete jobs are deleted, and whether existing files can be overwritten by an upload job.

User interface name Description

Maximum file size

Defines the maximum size of a file that can be uploaded in a single BITS Server job. By default, there is no maximum file size.

Delete incomplete jobs after

Defines how long BITS Server will wait until cleaning up incomplete upload files. The timeout is checked each time the cleanup process is scheduled to run. See Cleanup to configure the frequency with which the cleanup process should be run for this virtual directory.

Allow files to be overwritten

This setting defines if BITS Upload server allows existing files to be overwritten in the virtual directory. This setting is disabled by default to prevent unauthorized users from overwriting legitimately uploaded files by uploading a file with the same name. Attempts to overwrite a file result in the second upload job failing. If two upload jobs have the same destination file name, the second upload job fails, even if an overwriting attempt is not being made purposely. If you enable this setting, you allow files to be overwritten.

Note that by enabling this setting, BITS Upload server is still not allowed to write to files outside the virtual directory, and unauthorized users cannot overwrite the system’s files using BITS Upload server.

Notifications

By enabling notifications, you can configure BITS Server to send a notification via an HTTP POST to a URL you specify when a file is uploaded to the virtual directory.

User interface name Description

Enable notifications

Enables notifications for this virtual directory. The Notification type and Notification URL settings are both required if this setting is enabled.

Notification type

Configures the type of notification to perform after the job is completed.

  • Send the file name: The server passes the path to the completed upload file to the URL specified by the Notification URL setting. The server may return a file to the client as a response.

  • Send the file contents: The server passes the entire completed upload file to the URL specified by the Notification URL as the entity body of the HTTP POST. The response entity is sent to the client.

Notification URL

Specifies the URL to which to pass the completed upload file using an HTTP POST request if the Notification type is Send the file contents or Send the file name. The URL may be absolute or relative. If the URL is relative, then the original request URL is used as the base.

Cleanup

Every 12 hours the BITS Server checks for and deletes incomplete upload jobs that have timed out.This is the default behavior, however; you can configure BITS Server to scan at a different frequency.

If an incomplete upload is found, BITS Server checks the Delete incomplete jobs after setting. If the progress of the upload is delayed and subsequently exceeds the timeout period, BITS Server automatically cancels the upload and deletes any partial file contents. This setting is not affected by IIS property inheritance and applies only to this virtual directory.

User interface name | Description
Use default schedule | Configures BITS Server to scan every 12 hours and delete any incomplete jobs that are older than the time specified in the Delete incomplete jobs after setting.
Use Custom Schedule | Configures the type of notification to perform after the job is completed.
Scan for incomplete jobs every | Configures BITS Server to scan at the frequency selected and delete any incomplete jobs that are older than the time specified in the Delete incomplete jobs after setting.
Enable Cleanup to limit the number of sessions per user | Configures BITS Server to remove jobs uploaded by a user that exceeds the value specified in Limit on the number of sessions per user.
Limit on the number of sessions per user | Specifies how many active upload jobs a user may submit to the BITS Server.
Note

You can manually run a cleanup task, by clicking Run Cleanup from the IIS Manager Actions pane. This immediately starts a check for files that have had no progress since the timeout period. To remove all incomplete files for this virtual directory, set the Delete incomplete jobs after setting to 0 before running the cleanup.

Server farm support

If enabled, this setting informs the client to try to reconnect to the same server instead of the original upload URL that was used by the client. This allows clients that are uploading to server farms to continue uploading to the same server where the upload started.

Server farms can be configured in one of two ways:

  1. By using a shared volume for the upload virtual directory

  2. By using server local storage for the uploaded files

If you wish to use local storage, then this option will enable the client to reconnect to the same server machine in the server farm. Uploading to server farms and using local storage is not recommended without enabling and configuring this feature.

User interface name Description

Enable Server Farm Support

Enables BITS Server uploads support for server farms.

Reconnect to IP address

Specifies the public IP address to use for reconnecting to this server. A common configuration for a server will have two IP addresses: one that is outward pointing and that is reachable by client systems, and one that is part of the inner (protected) network. You should specify the outward-pointing IP address here.

Note

You can specify a DNS name here only if each machine in your Web farm has an independent DNS name that is resolvable by the client machines.

Use original IP address after

If a client cannot reconnect to the server at the Reconnect to IP address for this amount of time, then the clients will revert to the original DNS name they specified in the upload URL.


Disable BITS Server Scripting

IIS allows a user to set the script and execute permissions on a virtual directory separately from its write permissions. Normally, administrators who wish to allow script and program execution on a virtual directory disallow writing to that virtual directory (this will keep clients from uploading executable scripts or programs to a directory and executing them). However, when a virtual directory is BITS Server enabled, even though write permissions on the virtual directory have been disallowed, clients can write to this directory via BITS Server.

To protect the server, BITS Server disables all script and execute permissions on a BITS upload–enabled virtual directory. To make sure that this virtual directory is secure, BITS Server will check to make sure that these permissions are disabled before responding to any client request for uploading data. If these permissions are enabled at any time, BITS Server will deny all upload requests thereafter, until the permissions are disabled again. Every time the BITS Server denies a request in such an environment, it will write a log entry in the IIS logs.