PFFileUploadController
Objective-C
@protocol PFFileUploadController <NSObject>
Swift
protocol PFFileUploadController : NSObjectProtocol
A policy interface for overriding the default upload behavior of uploading a PFFileObject to application’s parse server. Allows for direct uploads to other file storage providers.
-
Uploads a file asynchronously from file path for a given file state.
Declaration
Objective-C
- (BFTask<PFFileUploadResult *> *_Nonnull) uploadSourceFilePath:(NSString *_Nonnull)sourceFilePath fileName:(NSString *_Nullable)fileName mimeType:(NSString *_Nullable)mimeType sessionToken:(NSString *_Nonnull)sessionToken cancellationToken:(id)cancellationToken progressBlock:(PFProgressBlock _Nonnull)progressBlock;Swift
func uploadSourceFilePath(_ sourceFilePath: String, fileName: String?, mimeType: String?, sessionToken: String, cancellationToken: Any!, progressBlock: Any!) -> Any!Parameters
sourceFilePathPath to the file to upload.
fileNameThe PFFileObject’s fileName.
mimeTypeThe PFFileObject’s mime type.
sessionTokenThe current users’s session token.
cancellationTokenCancellation token.
progressBlockProgress block to call (optional).
Return Value
BFTaskwith a success result set toPFFileUploadResultcontaining the url and name of the uploaded file.
View on GitHub
Install in Dash