IBackgroundCopyFile3::GetTemporaryName method

Gets the full path of the temporary file that contains the content of the download.

Syntax

HRESULT GetTemporaryName(
  LPWSTR *pFilename
);

Parameters

pFilename

Return Value

The method returns the following return values.

Return code Description
S_OK
Success

Remarks

Applications can use this method to gain access to the data before the job is complete. Open the file for shared write access (FILE_SHARE_WRITE). To determine how many bytes have been transferred and are available for reading, call the IBackgroundCopyFile::GetProgress method. Note that the progress information will be set back to zero if the time stamp of the URL changes.

Do not open the file for reading until BITS begins transferring the file; otherwise, the job will go into the transient error state.

The temporary file is available until the application calls the IBackgroundCopyJob::Complete or IBackgroundCopyJob::Cancel method, or the JobInactivityTimeout group policy expires. You must release your handle to the temporary file before calling the Complete or Cancel method.

The ACL for the temporary file is the same as that of the final file when Complete is called (the ACL is inherited from the folder).

To determine if BITS finished transferring the file, you can:

Requirements

   
Windows version Windows Vista Windows Server 2008
Target Platform Windows
Header bits3_0.h (include Bits.h)
Library Bits.lib

See Also

IBackgroundCopyCallback2::FileTransferred

IBackgroundCopyFile3