This sample
demonstrates the usage of BITS APIs to upload a file.
BITS allows uploads of single files to a remote IIS server. The server must be
preconfigured to accept those uploads. An example of
how to do that can be found in the \web\bits\upload sample. You can also find
the specific requirements for uploads in the BITS documentation. This sample of
code is designed to show the difference between upload and download jobs.
UPLOADS.cpp
builds on the concepts established in the DOWNLOADS.cpp example, it is
recommended that you review DOWNLOADS.cpp prior to reviewing this sample – it
will aid understanding of the program flow. The key difference between the two
samples is that the BG_JOB_TYPE_UPLOAD option is used when creating the job
hr = pQueueMgr->CreateJob(L"Upload", BG_JOB_TYPE_UPLOAD, &guidJob,&pJob);
Other than
that, and the direction of data flow, the two examples are identical. The one
thing you should be aware of is that only one file can be added to an upload
job. Notifications are available on upload jobs. Please see the BITS
documentation for more information.