Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/kotlin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
File upload DropboxSDK:What';DBRestClient中uploadFileChunk:over-uploadFile:的好处是什么?_File Upload_Dropbox_Dropbox Api - Fatal编程技术网

File upload DropboxSDK:What';DBRestClient中uploadFileChunk:over-uploadFile:的好处是什么?

File upload DropboxSDK:What';DBRestClient中uploadFileChunk:over-uploadFile:的好处是什么?,file-upload,dropbox,dropbox-api,File Upload,Dropbox,Dropbox Api,序言: 如果你觉得这可能是一个重复,那么我不得不让你失望-我的问题不是如何做上传。相反,我的问题是比较两种上传方法的优缺点。另一个问题没有涉及到这一点,所以我的问题不是重复的 问题: 对于使用DropboxSDK上载文件,有两种方法用于两种不同的方法。评论只说有一种方法“对于大于几兆字节的文件更好”。具体的好处是什么?第二种方法似乎更难使用,那么它有什么优势呢 以下是iOS DropboxSDK中的两种方法: 一,。 上传文件: /* Uploads a file that will be na

序言:

如果你觉得这可能是一个重复,那么我不得不让你失望-我的问题不是如何做上传。相反,我的问题是比较两种上传方法的优缺点。另一个问题没有涉及到这一点,所以我的问题不是重复的

问题:

对于使用DropboxSDK上载文件,有两种方法用于两种不同的方法。评论只说有一种方法“对于大于几兆字节的文件更好”。具体的好处是什么?第二种方法似乎更难使用,那么它有什么优势呢

以下是iOS DropboxSDK中的两种方法:

一,。
上传文件:

/* Uploads a file that will be named filename to the given path on the server. sourcePath is the`
   full path of the file you want to upload. If you are modifying a file, parentRev represents the
   rev of the file before you modified it as returned from the server. If you are uploading a new
   file set parentRev to nil. */
- (void)uploadFile:(NSString *)filename toPath:(NSString *)path withParentRev:(NSString *)parentRev
    fromPath:(NSString *)sourcePath;
二,。
uploadFileChunk:

/* These calls allow you to upload files in chunks, which is better for file larger than a few megabytes.
   You can append bytes to the file using -[DBRestClient uploadFileChunk:offset:uploadId:] and then call
   -[DBRestClient uploadFile:toPath:withParentRev:fromUploadId:] to turn the bytes appended at that uploadId
   into an actual file in the user's Dropbox.
   Use a nil uploadId to start uploading a new file. */
- (void)uploadFileChunk:(NSString *)uploadId offset:(unsigned long long)offset fromPath:(NSString *)localPath;
见和

前者允许高达150MB的空间,并在一个HTTP请求中写入文件,因此如果不从头开始,就无法恢复失败的上载

后者允许任何大小,任何失败的上传都可以在停止的地方恢复(只需发送下一个块)。

示例: