<?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 -uploadSessionFinishBatchCheck: - Getting path from errors in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/uploadSessionFinishBatchCheck-Getting-path-from-errors/m-p/191846#M8441</link>
    <description>&lt;P&gt;Great, thank you again. I now have most of this working with one thing I still haven't managed:&lt;BR /&gt;&lt;BR /&gt;- If DBFILESUploadSessionFinishBatchResultEntry results in -isFailure, how do I get the path the entry was trying to upload to? If there's a failure, I check the reasons and try re-uploading if possible. But in order to do that, I need the upload path so that I can retrieve information about the local file I was trying to upload and try again.&lt;BR /&gt;&lt;BR /&gt;This isn't a problem with the non-batch methods, because the completion handlers have access to the path or information you passed into the calling methods. And in API 1's -restClient: uploadFromUploadIdFailedWithError: method, you could get the upload path from the "destPath" key of the NSError's userInfo dictionary.&lt;BR /&gt;&lt;BR /&gt;I can't find a way of retrieving this information in API 2's batch checks, however. DBFILESUploadSessionFinishBatchResultEntry only provides failure (DBFILESUploadSessionFinishError) and success (meta-data) objects. The meta-data object isn't available in the case of a failure. And DBFILESUploadSessionFinishError provides no access to the path, nor do any of the properties on it.&lt;BR /&gt;&lt;BR /&gt;Given that the upload path is vital information if a DBFILESUploadSessionFinishBatchResultEntry entry results in failure, I assume there must be some way of retrieving it, so could you please tell me what I'm missing?&lt;BR /&gt;&lt;BR /&gt;i.e.:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;DBRpcTask *checkTask = [self.dropboxClient.filesRoutes uploadSessionFinishBatchCheck:asyncJobId];
[self.dropboxClient.filesRoutes response:^(DBFILESUploadSessionFinishBatchJobStatus *status, DBASYNCPollError *pollError, DBError *dbError){
	if (status)
	{
		if (status.isComplete)
		{
			// Go through results.
			for (DBFILESUploadSessionFinishBatchResultEntry *result in status.complete.entries)
			{
                    		if (result.isSuccess)
                   		{
                        		DBFILESFileMetadata *metaData = result.success;
                        		// Do something (e.g. ensure local date and meta-data date are the same).
                        	}
                    	}
                    	else if (result.isFailure)
                    	{
                        	DBFILESUploadSessionFinishError *error = result.failure;

				// How do I find exactly which file failed to upload? What is the path
				// on Dropbox that did not get uploaded?
                    	}
		}
	}
	else // if (status.isInProgress)
	{
		// Call this method to poll again after a delay.
	}
}
else    // Error!
{
	// Handle errors.
}
}];&lt;/PRE&gt;
&lt;P&gt;(Alternatively, the sessionID associated with the chunked upload would be fine if I could retrieve that from the error, because I could record that against the file I was uploading at the start of the upload and then use it to look up the file on failure. Basically, I just need some information from the failure error that I can use to look up what exactly has failed.)&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;Keith&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;P.S. I tried posting this twice as a reply to the other thread about uploading chunks, but each time I submitted, it failed to show up on the forum.&lt;/P&gt;</description>
    <pubDate>Wed, 29 May 2019 09:28:58 GMT</pubDate>
    <dc:creator>Keith B.7</dc:creator>
    <dc:date>2019-05-29T09:28:58Z</dc:date>
    <item>
      <title>-uploadSessionFinishBatchCheck: - Getting path from errors</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/uploadSessionFinishBatchCheck-Getting-path-from-errors/m-p/191846#M8441</link>
      <description>&lt;P&gt;Great, thank you again. I now have most of this working with one thing I still haven't managed:&lt;BR /&gt;&lt;BR /&gt;- If DBFILESUploadSessionFinishBatchResultEntry results in -isFailure, how do I get the path the entry was trying to upload to? If there's a failure, I check the reasons and try re-uploading if possible. But in order to do that, I need the upload path so that I can retrieve information about the local file I was trying to upload and try again.&lt;BR /&gt;&lt;BR /&gt;This isn't a problem with the non-batch methods, because the completion handlers have access to the path or information you passed into the calling methods. And in API 1's -restClient: uploadFromUploadIdFailedWithError: method, you could get the upload path from the "destPath" key of the NSError's userInfo dictionary.&lt;BR /&gt;&lt;BR /&gt;I can't find a way of retrieving this information in API 2's batch checks, however. DBFILESUploadSessionFinishBatchResultEntry only provides failure (DBFILESUploadSessionFinishError) and success (meta-data) objects. The meta-data object isn't available in the case of a failure. And DBFILESUploadSessionFinishError provides no access to the path, nor do any of the properties on it.&lt;BR /&gt;&lt;BR /&gt;Given that the upload path is vital information if a DBFILESUploadSessionFinishBatchResultEntry entry results in failure, I assume there must be some way of retrieving it, so could you please tell me what I'm missing?&lt;BR /&gt;&lt;BR /&gt;i.e.:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;DBRpcTask *checkTask = [self.dropboxClient.filesRoutes uploadSessionFinishBatchCheck:asyncJobId];
[self.dropboxClient.filesRoutes response:^(DBFILESUploadSessionFinishBatchJobStatus *status, DBASYNCPollError *pollError, DBError *dbError){
	if (status)
	{
		if (status.isComplete)
		{
			// Go through results.
			for (DBFILESUploadSessionFinishBatchResultEntry *result in status.complete.entries)
			{
                    		if (result.isSuccess)
                   		{
                        		DBFILESFileMetadata *metaData = result.success;
                        		// Do something (e.g. ensure local date and meta-data date are the same).
                        	}
                    	}
                    	else if (result.isFailure)
                    	{
                        	DBFILESUploadSessionFinishError *error = result.failure;

				// How do I find exactly which file failed to upload? What is the path
				// on Dropbox that did not get uploaded?
                    	}
		}
	}
	else // if (status.isInProgress)
	{
		// Call this method to poll again after a delay.
	}
}
else    // Error!
{
	// Handle errors.
}
}];&lt;/PRE&gt;
&lt;P&gt;(Alternatively, the sessionID associated with the chunked upload would be fine if I could retrieve that from the error, because I could record that against the file I was uploading at the start of the upload and then use it to look up the file on failure. Basically, I just need some information from the failure error that I can use to look up what exactly has failed.)&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;Keith&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;P.S. I tried posting this twice as a reply to the other thread about uploading chunks, but each time I submitted, it failed to show up on the forum.&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:28:58 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/uploadSessionFinishBatchCheck-Getting-path-from-errors/m-p/191846#M8441</guid>
      <dc:creator>Keith B.7</dc:creator>
      <dc:date>2019-05-29T09:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: -uploadSessionFinishBatchCheck: - Getting path from errors</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/uploadSessionFinishBatchCheck-Getting-path-from-errors/m-p/191862#M8450</link>
      <description>&lt;P&gt;Sorry about the trouble with the forum! I think that got cleared up though, so I went and deleted the duplicates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway, these failure results don't return the session ID or path. (There's some complexity here unfortunately, but we'll consider it a feature request.) Instead, you should use the index of the result in the result list to correlate back to the list sent to FinishBatch.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2016 22:42:49 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/uploadSessionFinishBatchCheck-Getting-path-from-errors/m-p/191862#M8450</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2016-10-24T22:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: -uploadSessionFinishBatchCheck: - Getting path from errors</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/uploadSessionFinishBatchCheck-Getting-path-from-errors/m-p/191866#M8453</link>
      <description>&lt;P&gt;Thanks for retrieving my post!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the reply, too. I realised that one way I could get a list of the failures was by checking a cached list of what was currently being uploaded against the meta-data for successful uploaded files - everything else being a failure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using the index is even better, though: so is it always safe to assume that the [(DBFILESUploadSessionFinishBatchJobStatus *)status complete].entries,&amp;nbsp;array will be in&amp;nbsp;the same order as the finish args passed into -uploadSessionFinishBatch:? (I'm used to results like this having no guaranteed order.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Keith&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2016 23:23:19 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/uploadSessionFinishBatchCheck-Getting-path-from-errors/m-p/191866#M8453</guid>
      <dc:creator>Keith B.7</dc:creator>
      <dc:date>2016-10-24T23:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: -uploadSessionFinishBatchCheck: - Getting path from errors</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/uploadSessionFinishBatchCheck-Getting-path-from-errors/m-p/191871#M8454</link>
      <description>Yes, the order for that response is guaranteed to match. (I'll make a note to get that clearly documented.)</description>
      <pubDate>Mon, 24 Oct 2016 23:51:37 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/uploadSessionFinishBatchCheck-Getting-path-from-errors/m-p/191871#M8454</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2016-10-24T23:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: -uploadSessionFinishBatchCheck: - Getting path from errors</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/uploadSessionFinishBatchCheck-Getting-path-from-errors/m-p/192100#M8492</link>
      <description>&lt;P&gt;Great, thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2016 14:50:01 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/uploadSessionFinishBatchCheck-Getting-path-from-errors/m-p/192100#M8492</guid>
      <dc:creator>Keith B.7</dc:creator>
      <dc:date>2016-10-26T14:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: -uploadSessionFinishBatchCheck: - Getting path from errors</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/uploadSessionFinishBatchCheck-Getting-path-from-errors/m-p/192298#M8533</link>
      <description>&lt;P&gt;Unfortunately, it turns out the order doesn't match after all, as explained here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.dropboxforum.com/t5/API-support/Meta-data-unreliable-in/m-p/192288/highlight/false#M8529" target="_blank"&gt;https://www.dropboxforum.com/t5/API-support/Meta-data-unreliable-in/m-p/192288/highlight/false#M8529&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've therefore returned to my previous method.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and all the best,&lt;BR /&gt;Keith&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2016 18:41:06 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/uploadSessionFinishBatchCheck-Getting-path-from-errors/m-p/192298#M8533</guid>
      <dc:creator>Keith B.7</dc:creator>
      <dc:date>2016-10-27T18:41:06Z</dc:date>
    </item>
  </channel>
</rss>

