BITS Upload Sample

Summary

This sample demonstrates a simple application that uses BITS to upload files to a IIS server using the HTTP protocol. BITS allows for file transfers that consume only 'idle' bandwith and that are automatically restarted after interruptions such as network outages, machine reboots or user logoff.

The UI for the Upload Sample captures text entered by the user, and packs it as an XML file. This XML file is in turn uploaded to the IIS server.

If the check box Process a reply from the server after the completion of the upload job is checked, and the file is uploaded to a virtual directory that has BITS Extensions notification enabled, then the app will receive a reply from the server, and will display its content in the Job Status area.

Key Concepts

Build/Configuration instructions

  1. Run "nmake" in the directory where the sources are.
  2. Change the current directory to the binary output directory in the SDK.
  3. Run the configuration script, by executing "cscript configure.js <physicalpath_root_for_virtualdirectories>". Execute only "cscript configure.js" to obtain usage information.
  4. Execute uploadsample.exe.

Basic Usage

Upload

  1. Select http://localhost/UploadSample in the Upload file to the following virtual directory combo-box (or type the URL for a virtual directory with BITS Extensions enabled).
  2. Type some words in the Pack the following text in an XML file edit box.
  3. Click the Upload file button.
  4. Check if a file with a name in the format "uplxxxx.xml" was uploaded to the UploadSample virtual directory.

Upload-Reply

  1. Select http://localhost/UploadSampleWithNotifications in the Upload file to the following virtual directory combo-box (or type the URL for a virtual directory with BITS Extensions enabled, and Notification settings adjusted to execute the ASP script newupload.asp).
  2. Type some words in the Pack the following text in an XML file edit box
  3. Click the Upload file button
  4. Check if a file with a name in the format "uplxxxx.xml" was uploaded to the UploadSample virtual directory
  5. Check in the Job Status area if a reply was received from the server

System configuration

Questions

For development and deployment questions on BITS 1.5, please post a message to the newsgroup microsoft.public.windows.backgroundtransfer, or contact Microsoft Support.
Known issues are commonly published as Knowledge Base (KB) articles. Please go to http://www.microsoft.com/support and search using the term "Background Intelligent Transfer Service".