Client
@objc(FSClient)
public class Client : NSObject
Represents a client that allows communicating with the Filestack REST API.
-
Uploads a single local URL directly to a given storage location.
Currently the only storage location supported is Amazon S3.
Important
If your uploadable can not return a MIME type (e.g. when passing
Dataas the uploadable), you must pass a customUploadOptionswith customstoreOptionsinitialized with amimeTypethat better represents your uploadable, otherwisetext/plainwill be assumed.Note
This function is made available especially for Objective-C SDK users. If you are using Swift, you might want to use
upload(using:options:queue:uploadProgress:completionHandler:)instead.Declaration
Swift
@discardableResult @objc public func uploadURL(using localURL: NSURL, options: UploadOptions = .defaults, queue: DispatchQueue = .main, uploadProgress: ((Progress) -> Void)? = nil, completionHandler: @escaping (JSONResponse) -> Void) -> UploaderParameters
localURLThe URL of the local file to be uploaded.
optionsA set of upload options (see
UploadOptionsfor more information.)queueThe queue on which the upload progress and completion handlers are dispatched.
uploadProgressSets a closure to be called periodically during the lifecycle of the upload process as data is uploaded to the server.
nilby default.completionHandlerAdds a handler to be called once the upload has finished.
Return Value
An
Uploaderthat allows starting, cancelling and monitoring the upload. -
Uploads an array of local URLs directly to a given storage location.
Currently the only storage location supported is Amazon S3.
Important
If your uploadable can not return a MIME type (e.g. when passing
Dataas the uploadable), you must pass a customUploadOptionswith customstoreOptionsinitialized with amimeTypethat better represents your uploadable, otherwisetext/plainwill be assumed.Note
This function is made available especially for Objective-C SDK users. If you are using Swift, you might want to use
upload(using:options:queue:uploadProgress:completionHandler:)instead.Declaration
Swift
@discardableResult @objc public func uploadMultipleURLs(using localURLs: [NSURL], options: UploadOptions = .defaults, queue: DispatchQueue = .main, uploadProgress: ((Progress) -> Void)? = nil, completionHandler: @escaping ([JSONResponse]) -> Void) -> UploaderParameters
localURLsThe URL of the local file to be uploaded.
optionsA set of upload options (see
UploadOptionsfor more information.)queueThe queue on which the upload progress and completion handlers are dispatched.
uploadProgressSets a closure to be called periodically during the lifecycle of the upload process as data is uploaded to the server.
nilby default.completionHandlerAdds a handler to be called once the upload has finished.
Return Value
An
Uploaderthat allows starting, cancelling and monitoring the upload. -
Uploads data directly to a given storage location.
Currently the only storage location supported is Amazon S3.
Important
If your uploadable can not return a MIME type (e.g. when passing
Dataas the uploadable), you must pass a customUploadOptionswith customstoreOptionsinitialized with amimeTypethat better represents your uploadable, otherwisetext/plainwill be assumed.Note
This function is made available especially for Objective-C SDK users. If you are using Swift, you might want to use
upload(using:options:queue:uploadProgress:completionHandler:)instead.Declaration
Swift
@discardableResult @objc public func uploadData(using data: NSData, options: UploadOptions = .defaults, queue: DispatchQueue = .main, uploadProgress: ((Progress) -> Void)? = nil, completionHandler: @escaping (JSONResponse) -> Void) -> UploaderParameters
dataThe data to be uploaded.
optionsA set of upload options (see
UploadOptionsfor more information.)queueThe queue on which the upload progress and completion handlers are dispatched.
uploadProgressSets a closure to be called periodically during the lifecycle of the upload process as data is uploaded to the server.
nilby default.completionHandlerAdds a handler to be called once the upload has finished.
Return Value
An
Uploaderthat allows starting, cancelling and monitoring the upload. -
Uploads multiple data directly to a given storage location.
Currently the only storage location supported is Amazon S3.
Important
If your uploadable can not return a MIME type (e.g. when passing
Dataas the uploadable), you must pass a customUploadOptionswith customstoreOptionsinitialized with amimeTypethat better represents your uploadable, otherwisetext/plainwill be assumed.Note
This function is made available especially for Objective-C SDK users. If you are using Swift, you might want to use
add(uploadables:)instead.Declaration
Swift
@discardableResult @objc public func uploadMultipleData(using multipleData: [NSData], options: UploadOptions = .defaults, queue: DispatchQueue = .main, uploadProgress: ((Progress) -> Void)? = nil, completionHandler: @escaping ([JSONResponse]) -> Void) -> UploaderParameters
multipleDataThe array of data objects to be uploaded.
optionsA set of upload options (see
UploadOptionsfor more information.)queueThe queue on which the upload progress and completion handlers are dispatched.
uploadProgressSets a closure to be called periodically during the lifecycle of the upload process as data is uploaded to the server.
nilby default.completionHandlerAdds a handler to be called once the upload has finished.
Return Value
An
Uploaderthat allows starting, cancelling and monitoring the upload.
-
An API key obtained from the Developer Portal.
Declaration
Swift
@objc var apiKey: String { get } -
Returns whether there’s at least a single
Uploaderinstance currently running.Declaration
Swift
@objc var isUploading: Bool { get }
-
A
Transformableobject for a Filestack handle.See also
Declaration
Swift
@objc func transformable(handle: String) -> TransformableParameters
handleA Filestack handle.
-
A
Transformableobject for an array of Filestack handles.See also
Declaration
Swift
@objc func transformable(handles: [String]) -> TransformableParameters
handlesAn array of Filestack handles.
-
A
Transformableobject for an external URL.See also
Declaration
Swift
@objc func transformable(externalURL: URL) -> TransformableParameters
externalURLAn external URL.
-
A
Transformableobject for an array of external URLs.See also
Declaration
Swift
@objc func transformable(externalURLs: [URL]) -> TransformableParameters
externalURLsAn array of external URLs.
-
Uploads a single
Uploadableto a given storage location.Currently the only storage location supported is Amazon S3.
Important
If your uploadable can not return a MIME type (e.g. when passing
Dataas the uploadable), you must pass a customUploadOptionswith customstoreOptionsinitialized with amimeTypethat better represents your uploadable, otherwisetext/plainwill be assumed.Declaration
Swift
@discardableResult func upload(using uploadable: Uploadable, options: UploadOptions = .defaults, queue: DispatchQueue = .main, uploadProgress: ((Progress) -> Void)? = nil, completionHandler: @escaping (JSONResponse) -> Void) -> UploaderParameters
uploadableAn item to upload conforming to
Uploadable.optionsA set of upload options (see
UploadOptionsfor more information.)queueThe queue on which the upload progress and completion handlers are dispatched.
uploadProgressSets a closure to be called periodically during the lifecycle of the upload process as data is uploaded to the server.
nilby default.completionHandlerAdds a handler to be called once the upload has finished.
Return Value
An
Uploaderthat allows starting, cancelling and monitoring the upload. -
Uploads an array of
Uploadableitems to a given storage location.Currently the only storage location supported is Amazon S3.
Important
If your uploadables can not return a MIME type (e.g. when passing
Dataas the uploadable), you must pass a customUploadOptionswith customstoreOptionsinitialized with amimeTypethat better represents your uploadables, otherwisetext/plainwill be assumed.Declaration
Swift
@discardableResult func upload(using uploadables: [Uploadable]? = nil, options: UploadOptions = .defaults, queue: DispatchQueue = .main, uploadProgress: ((Progress) -> Void)? = nil, completionHandler: @escaping ([JSONResponse]) -> Void) -> Uploader & DeferredAddParameters
uploadablesAn array of items to upload conforming to
Uploadable. May benilif you intend to add them later to the returnedMultifileUploadobject.optionsA set of upload options (see
UploadOptionsfor more information.)queueThe queue on which the upload progress and completion handlers are dispatched.
uploadProgressSets a closure to be called periodically during the lifecycle of the upload process as data is uploaded to the server.
nilby default.completionHandlerAdds a handler to be called once the upload has finished.
Return Value
An
Uploader & DeferredAddthat allows starting, cancelling and monitoring the upload, plus addingUploadablesat a later time.
View on GitHub
Client Class Reference