Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSURLDownloadMBS class.

NSURLDownloadMBS.cancel

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Networking MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Cancels the receiver's download and deletes the downloaded file.

NSURLDownloadMBS.Constructor(request as NSURLRequestMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Networking MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns an initialized URL download for a URL request and begins to download the data for the request.

request: The URL request to download. The request object is deep-copied as part of the initialization process. Changes made to request after this method returns do not affect the request that is used for the loading process.

On success the handle property is not zero.

See also:

NSURLDownloadMBS.Constructor(resumeData as Memoryblock, path as folderitem)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Networking MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns an initialized NSURLDownload object that will resume downloading the specified data to the specified file and begins the download.

resumeData: Specifies the data to resume downloading.
path: The location for the downloaded data.

On success the handle property is not zero.

See also:

NSURLDownloadMBS.Constructor(resumeData as Memoryblock, path as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Networking MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns an initialized NSURLDownload object that will resume downloading the specified data to the specified file and begins the download.

resumeData: Specifies the data to resume downloading.
path: The location for the downloaded data.

On success the handle property is not zero.

See also:

NSURLDownloadMBS.deletesFileUponFailure as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Networking MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Whether the receiver deletes partially downloaded files when a download stops prematurely.

True if partially downloaded files should be deleted when a download stops prematurely, false otherwise. The default is true.
(Read and Write computed property)

Some examples using this property:

NSURLDownloadMBS.request as NSURLRequestMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Networking MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the request that initiated the receiver's download.

NSURLDownloadMBS.resumeData as Memoryblock

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Networking MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the resume data for a download that is not yet complete.

The resume data for a download that is not yet complete. This data represents the necessary state information that an NSURLDownload object needs to resume a download. The resume data can later be used when initializing a download with Constructor. Returns nil if the download is not able to be resumed.

Resume data will only be returned if the protocol of the download as well as the server support resuming. In order to later resume a download you must call setDeletesFileUponFailure passing false so the partially downloaded data is not deleted when the initial connection is lost or canceled.

Some examples using this method:

NSURLDownloadMBS.setDestination(path as folderitem, allowOverwrite as boolean)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Networking MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Sets the destination path of the downloaded file.

path: The path for the downloaded file.
allowOverwrite: true if an existing file at path can be replaced, false otherwise.

If allowOverwrite is false and a file already exists at path, a unique filename will be created for the downloaded file by appending a number to the filename. The delegate can implement didCreateDestination to determine the filename used when the file is written to disk.

An NSURLDownload instance ignores multiple calls to this method.

See also:

NSURLDownloadMBS.setDestination(path as string, allowOverwrite as boolean)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Networking MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Sets the destination path of the downloaded file.

path: The path for the downloaded file.
allowOverwrite: true if an existing file at path can be replaced, false otherwise.

If allowOverwrite is false and a file already exists at path, a unique filename will be created for the downloaded file by appending a number to the filename. The delegate can implement didCreateDestination to determine the filename used when the file is written to disk.

An NSURLDownload instance ignores multiple calls to this method.

See also:

The items on this page are in the following plugins: MBS MacBase Plugin.


The biggest plugin in space...