Platforms to show: All Mac Windows Linux Cross-Platform
NSURLDownloadMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Cocoa Networking | MBS MacBase Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
NSURLDownload downloads a request asynchronously and saves the data to a file. The interface for NSURLDownload is sparse, providing methods to initialize a download, set the destination path and cancel loading the request.
NSURLDownload's delegate methods—defined by the NSURLDownloadDelegate—allow an object to receive informational callbacks about the asynchronous load of the URL request. Other delegate methods provide facilities that allow the delegate to customize the process of performing an asynchronous URL load.
Note that these delegate methods are called on the thread that started the asynchronous load operation for the associated NSURLDownload object.
The MBS Plugins currently only implement a part of this class for use with WebDownloadDelegateMBS. So please contact us if you need more.
- 14 events
- event canAuthenticateAgainstProtectionSpace(protectionSpace as NSURLProtectionSpaceMBS) as boolean
- event decideDestinationWithSuggestedFilename(filename as string)
- event DidBegin
- event didCancelAuthenticationChallenge(challenge as NSURLAuthenticationChallengeMBS)
- event didCreateDestination(path as string, file as folderitem)
- event didFailWithError(error as NSErrorMBS)
- event DidFinish
- event didReceiveAuthenticationChallenge(challenge as NSURLAuthenticationChallengeMBS)
- event didReceiveDataOfLength(length as UInt64)
- event didReceiveResponse(response as NSURLResponseMBS)
- event shouldDecodeSourceDataOfMIMEType(encodingType as string) as boolean
- event shouldUseCredentialStorage as boolean
- event willResumeWithResponse(response as NSURLResponseMBS, startingByte as Int64)
- event willSendRequest(request as NSURLRequestMBS, redirectResponse as NSURLResponseMBS) as NSURLRequestMBS
- 2 properties
- property Handle as Integer
- property deletesFileUponFailure as boolean
- 8 methods
- method cancel
- method Constructor(request as NSURLRequestMBS)
- method Constructor(resumeData as Memoryblock, path as folderitem)
- method Constructor(resumeData as Memoryblock, path as string)
- method request as NSURLRequestMBS
- method resumeData as Memoryblock
- method setDestination(path as folderitem, allowOverwrite as boolean)
- method setDestination(path as string, allowOverwrite as boolean)
- shared method canResumeDownloadDecodedWithEncodingMIMEType(MimeType as string) as boolean
This class has no sub classes.
Some examples using this class:
Blog Entries
- MBS Xojo Plugins, version 19.1pr2
- Notes from the last days
- MBS Real Studio Plugins, version 11.3pr6
- MBS Real Studio Plugins, version 11.3pr5
Release notes
- Version 19.1
- Changed WebDownloadDelegateMBS and NSURLDownloadMBS classes to be thread safe.
The items on this page are in the following plugins: MBS MacBase Plugin.
NSURLCredentialStorageMBS - NSURLMBS