Carbon


Data Transfer Options Mask Constants

Header: URLAccess.h

Represent a mask that identifies the data transfer options to use when uploading or downloading data.

enum URLOpenFlags {
    kURLReplaceExistingFlag = 1,
    kURLBinHexFileFlag = 2,
    kURLExpandFileFlag = 4,
    kURLDisplayProgressFlag = 8,
    kURLDisplayAuthFlag = 16,
    kURLUploadFlag = 32,
    kURLIsDirectoryHintFlag = 64,
    kURLDoNotTryAnonymousFlag = 128,
    kURLDirectoryListingFlag = 256,
    kURLExpandAndVerifyFlag = 512,
    kURLNoAutoRedirectFlag = 1024,
    kURLDebinhexOnlyFlag = 2048,
    kURLReservedFlag = -2147483648
};

Constant descriptions

kURLReplaceExistingFlag

If the bit specified by this mask is set and the destination file or directory exists, the file or directory contents are replaced by the newly downloaded or uploaded data. If this bit is not set and the name of the file is specified and does exist, the URL Access Manager returns the result code kURLDestinationExistsError. If the name of the file or directory is not specified, the file or directory already exists, and the bit specified by this mask is not set, a number is appended to the name before any extension until a unique name is created, and the data is transferred to the new file or directory name without notifying the calling application that the name has changed. In the case of a download operation, your application can check the destination parameter of the functions URLSimpleDownload and URLDownload to obtain the new filename.

kURLBinHexFileFlag

If the bit specified by this mask is set, the URL Access Manager converts a nontext file that has a resource fork to BinHex format before uploading it.

kURLExpandFileFlag

If the bit specified by this mask is set, files in BinHex format are decoded. If version 5.0 of the Stuffit Engine is installed in the System Folder, the URL Access Manager uses it to expand the file.

kURLDisplayProgressFlag

If the bit specified by this mask is set, the URL Access Manager displays a nonmovable modal progress indicator during data transfer operations only if you have not provided a system event notification callback. On Mac OS X, dialog boxes will always be moveable. To handle data transfer events that occur while a progress indicator is being displayed, pass a UPP to your data transfer event notification callback in the eventProc parameter of the functions URLSimpleDownload, URLDownload, URLSimpleUpload, and URLUpload.

kURLDisplayAuthFlag

If the bit specified by this mask is set, the URL Access Manager displays a nonmovable modal authentication dialog box when user authentication is required only if you have not provided a system event notification callback. On Mac OS X, dialog boxes will always be moveable. To handle data transfer events that occur while an authentication dialog box is being displayed, pass a UPP to your data transfer event notification callback in the eventProc parameter of the functions URLSimpleDownload, URLDownload, URLSimpleUpload, and URLUpload. If the bit specified by this mask is clear, the user name and password properties of the URL rae used for authentication purposes. If these are not set, the URL Access Manager returns the result code kURLAuthenticationError.

kURLUploadFlag

If the bit specified by this mask is set, the function URLOpen will upload the file or directory to the specified URL.

kURLIsDirectoryHintFlag

If the bit specified by this mask is set, download operations assume that the URL points to a directory. Note that if you pass a pathname that specifies a file in the url parameter of the function URLSimpleDownload, the file is downloaded regardless of whether you specify kURLDirectoryListingFlag or KURLIsDirectoryHintFlag in the openFlags parameter.

kURLDoNotTryAnonymousFlag

If the bits specified by this mask is set, when FTP authentication occurs, the functions URLSimpleDownload, URLDownload, URLSimpleUpload, and URLUpload will not try to log on anonymously. Instead, they will rely on the setting of the mask constant kURLDisplayAuthFlag. If the bit specified by the kURLDoNotTryAnonymousFlag mask is not set, these functions will first attempt to log on anonymously.

kURLDirectoryListingFlag

If the bit specified by this mask is set, a listing of the directory, rather than the entire directory, is downloaded. If the URL points to a file instead of a directory, the file is downloaded. Note that if you pass a pathname that specifies a file in the url parameter of the function URLSimpleDownload, the file is downloaded regardless of whether you specify kURLDirectoryListingFlag or KURLIsDirectoryHintFlag in the openFlags parameter.

kURLExpandAndVerifyFlag

If this flag is available (that is, the File Signing shared library is available) and the bit specified by this mask is set, the signature attached to the file is verified. Success indicates that the file was signed by the certificate authority, but the certificate will not be displayed until after the file is downloaded.

kURLNoAutoRedirectFlag

If the bit specified by this mask is set, if an HTTP request returns a “redirect” status (300, 301, or 302), the transfer will complete without attempting to redirect to the next URL. Otherwise, redirects are followed until actual data is encountered or an error is returned.

kURLDebinhexOnlyFlag

If the bit specified by this mask is set, the internal engine is used to decode files, rather than the external Stuffit Engine, even if Stuffit is installed. This prevents the display of the Stuffit progress user interface. If you set this bit, you must also set the kURLExpandAndVerifyFlag mask.

kURLReservedFlag

Reserved for internal use.

The URLOpenFlags enumeration defines masks you can use to identify the data transfer options you want used when performing data transfer operations. You pass this mask in the openFlags parameter of the functions URLSimpleDownload, URLDownload, URLSimpleUpload, URLUpload, and URLOpen.

For upload operations, you can specify any of the following masks: kURLReplaceExistingFlag, kURLBinHexFileFlag, kURLDisplayProgressFlag, kURLDisplayAuthFlag, and kURLDoNotTryAnonymousFlag. For download operations, you can specify any of the following masks: kURLReplaceExistingFlag, kURLExpandFileFlag, kURLExpandAndVerifyFlag, kURLDisplayProgressFlag, kURLDisplayAuthFlag, kURLIsDirectoryHintFlag, kURLDoNotTryAnonymousFlag, and kURLDirectoryListingFlag.


© 2000 Apple Computer, Inc. (Last Updated 7/17/2000)