<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: [Obj-C V2] How to resume uploading a large file in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obj-C-V2-How-to-resume-uploading-a-large-file/m-p/270048#M15934</link>
    <description>&lt;P&gt;Hi Greg,&lt;/P&gt;
&lt;P&gt;Thanks for the reply&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;BR /&gt;
&lt;P&gt;What do you mean exactly when you ask "how can these be persisted?" Once you have that&amp;nbsp;DBUploadTask, you can call suspend, resume, or cancel if/when desired. You can keep that object whever you want, e.g., as a property of the controller.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes as a property, but how can a task be persisted... between session. To disk. To run again several hours later when the user next starts the app or next has network access?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, note that for larger files (over 150 MB maximum), you should use &lt;A href="https://dropbox.github.io/dropbox-sdk-obj-c/api-docs/latest/Classes/DBFILESUserAuthRoutes.html#/c:objc(cs)DBFILESUserAuthRoutes(im)uploadSessionStartUrl:" target="_self"&gt;upload sessions&lt;/A&gt; instead.&amp;nbsp;When doing so, you can keep track of progress in between the individual calls.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for that link: is there any sample code that uses upload sessions?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Wouter&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Mar 2018 16:03:31 GMT</pubDate>
    <dc:creator>Wouter V.</dc:creator>
    <dc:date>2018-03-26T16:03:31Z</dc:date>
    <item>
      <title>[Obj-C V2] How to resume uploading a large file</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obj-C-V2-How-to-resume-uploading-a-large-file/m-p/269936#M15923</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;I read the forum here, many answer to related questions point to discontinued stackoverflow documentation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Specific question: How can I resume uploading a large file using the obj-c V2 API.&lt;/P&gt;
&lt;P&gt;I am currently uploading as shown below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The&amp;nbsp;DBUploadTask has "cancel" and "resume" selectors. But how can these be persisted?&lt;/P&gt;
&lt;P&gt;Should I use another upload method?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there any sample-code?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Wouter&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;DBUploadTask *thisTask = [[[client.filesRoutes uploadUrl:remotePath
                                                        mode:[[DBFILESWriteMode alloc] initWithOverwrite]
                                                 autorename:@(NO)
                                             clientModified:nil
                                                       mute:nil
                                             propertyGroups:nil
                                                   inputUrl:localFilePath]
                   setResponseBlock:^(DBFILESFileMetadata *result, DBFILESUploadError *routeError, DBRequestError *error)
                   {
                       if (result)
                       {
			   // finished successfully
                       }
                       else {
                           id theError = routeError ? routeError : error;
                           DebugError( @"%@", theError);
                       }
                    }]
                    setProgressBlock:^(int64_t bytesDownloaded, int64_t totalBytesDownloaded, int64_t totalBytesExpectedToDownload) {
                        DebugLog(@"\nDownloaded: %.02f KB\nTotal done: %.02f KB\nTotal expected: %02.f KB\n", (CGFloat)bytesDownloaded/1024.0f, (CGFloat)totalBytesDownloaded/1024.0f, (CGFloat)totalBytesExpectedToDownload/1024.0f);
                    }
            ];&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:14:30 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obj-C-V2-How-to-resume-uploading-a-large-file/m-p/269936#M15923</guid>
      <dc:creator>Wouter V.</dc:creator>
      <dc:date>2019-05-29T09:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: [Obj-C V2] How to resume uploading a large file</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obj-C-V2-How-to-resume-uploading-a-large-file/m-p/270043#M15930</link>
      <description>&lt;P&gt;What do you mean exactly when you ask "how can these be persisted?" Once you have that&amp;nbsp;DBUploadTask, you can call suspend, resume, or cancel if/when desired. You can keep that object whever you want, e.g., as a property of the controller.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;        [thisTask suspend];
...
        [thisTask resume];
...
        [thisTask cancel];&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, note that for larger files (over 150 MB maximum), you should use &lt;A href="https://dropbox.github.io/dropbox-sdk-obj-c/api-docs/latest/Classes/DBFILESUserAuthRoutes.html#/c:objc(cs)DBFILESUserAuthRoutes(im)uploadSessionStartUrl:" target="_self"&gt;upload sessions&lt;/A&gt; instead.&amp;nbsp;When doing so, you can keep track of progress in between the individual calls.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Mar 2018 15:41:26 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obj-C-V2-How-to-resume-uploading-a-large-file/m-p/270043#M15930</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-03-26T15:41:26Z</dc:date>
    </item>
    <item>
      <title>Re: [Obj-C V2] How to resume uploading a large file</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obj-C-V2-How-to-resume-uploading-a-large-file/m-p/270048#M15934</link>
      <description>&lt;P&gt;Hi Greg,&lt;/P&gt;
&lt;P&gt;Thanks for the reply&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;BR /&gt;
&lt;P&gt;What do you mean exactly when you ask "how can these be persisted?" Once you have that&amp;nbsp;DBUploadTask, you can call suspend, resume, or cancel if/when desired. You can keep that object whever you want, e.g., as a property of the controller.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes as a property, but how can a task be persisted... between session. To disk. To run again several hours later when the user next starts the app or next has network access?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, note that for larger files (over 150 MB maximum), you should use &lt;A href="https://dropbox.github.io/dropbox-sdk-obj-c/api-docs/latest/Classes/DBFILESUserAuthRoutes.html#/c:objc(cs)DBFILESUserAuthRoutes(im)uploadSessionStartUrl:" target="_self"&gt;upload sessions&lt;/A&gt; instead.&amp;nbsp;When doing so, you can keep track of progress in between the individual calls.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for that link: is there any sample code that uses upload sessions?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Wouter&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Mar 2018 16:03:31 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obj-C-V2-How-to-resume-uploading-a-large-file/m-p/270048#M15934</guid>
      <dc:creator>Wouter V.</dc:creator>
      <dc:date>2018-03-26T16:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: [Obj-C V2] How to resume uploading a large file</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obj-C-V2-How-to-resume-uploading-a-large-file/m-p/270075#M15944</link>
      <description>&lt;P&gt;The single upload calls, i.e., the non-upload session methods such as&amp;nbsp;uploadUrl, are not meant for use over long periods of time, as they operate using only a single HTTPS request. If you need to manage an upload over a long period of time like this, upload sessions would work better. You can store the upload session's&amp;nbsp;sessionId (a String) and offset (an NSNumber) however you wish. An upload session is good for up to 48 hours.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't have a sample implementation of using upload sessions with&amp;nbsp;the Objective-C SDK unfortunately. There are some other samples that can serve as a guide in &lt;A href="https://www.dropboxforum.com/t5/API-support/Uploading-a-file-to-Dropbox-in-chunks-using-Objective-C/m-p/251512#M14473" target="_self"&gt;this thread&lt;/A&gt; though.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Mar 2018 17:16:00 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obj-C-V2-How-to-resume-uploading-a-large-file/m-p/270075#M15944</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-03-26T17:16:00Z</dc:date>
    </item>
    <item>
      <title>Re: [Obj-C V2] How to resume uploading a large file</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obj-C-V2-How-to-resume-uploading-a-large-file/m-p/270189#M15959</link>
      <description>&lt;P&gt;Thanks, that helps&lt;/P&gt;
&lt;P&gt;Wouter&lt;/P&gt;</description>
      <pubDate>Tue, 27 Mar 2018 13:20:45 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obj-C-V2-How-to-resume-uploading-a-large-file/m-p/270189#M15959</guid>
      <dc:creator>Wouter V.</dc:creator>
      <dc:date>2018-03-27T13:20:45Z</dc:date>
    </item>
  </channel>
</rss>

