<?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 Interpreting iOS upload example in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Interpreting-iOS-upload-example/m-p/216893#M11280</link>
    <description>&lt;P&gt;New to iOS development (this will become obvious shortly).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Trying to follow these instructions for making an upload style API request:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;let fileData = "testing data example".data(using: String.Encoding.utf8, allowLossyConversion: false)!

let request = client.files.upload(path: "/test/path/in/Dropbox/account", input: TestData.fileData)&lt;/PRE&gt;&lt;P&gt;I've managed to upload a sample text file by replacing 'TestData.fileData' with just 'fileData' but the file ends up being called 'account' with no extension. &amp;nbsp;What was 'TestData' supposed to represent?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, how do I upload other types of files (mp3, jpeg, etc.) &amp;nbsp;string.encoding.utf8 is clearly not the answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks for helping out the newbie &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@41457EF40051AFF130FDBFE21B496926/emoticons/1f609.png" alt=":winking_face:" title=":winking_face:" /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 29 May 2019 09:23:32 GMT</pubDate>
    <dc:creator>Vegepilot</dc:creator>
    <dc:date>2019-05-29T09:23:32Z</dc:date>
    <item>
      <title>Interpreting iOS upload example</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Interpreting-iOS-upload-example/m-p/216893#M11280</link>
      <description>&lt;P&gt;New to iOS development (this will become obvious shortly).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Trying to follow these instructions for making an upload style API request:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;let fileData = "testing data example".data(using: String.Encoding.utf8, allowLossyConversion: false)!

let request = client.files.upload(path: "/test/path/in/Dropbox/account", input: TestData.fileData)&lt;/PRE&gt;&lt;P&gt;I've managed to upload a sample text file by replacing 'TestData.fileData' with just 'fileData' but the file ends up being called 'account' with no extension. &amp;nbsp;What was 'TestData' supposed to represent?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, how do I upload other types of files (mp3, jpeg, etc.) &amp;nbsp;string.encoding.utf8 is clearly not the answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks for helping out the newbie &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@41457EF40051AFF130FDBFE21B496926/emoticons/1f609.png" alt=":winking_face:" title=":winking_face:" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:23:32 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Interpreting-iOS-upload-example/m-p/216893#M11280</guid>
      <dc:creator>Vegepilot</dc:creator>
      <dc:date>2019-05-29T09:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: Interpreting iOS upload example</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Interpreting-iOS-upload-example/m-p/216921#M11287</link>
      <description>&lt;P&gt;Apologies,&amp;nbsp;TestData.fileData should indeed just be&amp;nbsp;fileData (per the first line in the example).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, the path parameter should be the full path in the&amp;nbsp;Dropbox account where you want to upload the file, including the desired file extension.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, for example, instead of "/test/path/in/Dropbox/account", if you wanted to upload a file named "Resume.docx" into a folder named "Documents", the path should be "/Documents/Resume.docx".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Uploading files works the same regardless of file type. The example happens to use a string converted to a Data object for simplicity, but you can supply the data using a Data, URL, or InputStream object.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For instance, here's a more advanced example for uploading large files that uploads the file content by reading Data objects from an NSFileHandle:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://stackoverflow.com/documentation/dropbox-api/409/uploading-a-file/20600/uploading-a-file-from-nsfilehandle-using-upload-sessions-with-every-error-case-h#t=201704191803502783365" target="_blank"&gt;https://stackoverflow.com/documentation/dropbox-api/409/uploading-a-file/20600/uploading-a-file-from-nsfilehandle-using-upload-sessions-with-every-error-case-h#t=201704191803502783365&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2017 18:08:59 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Interpreting-iOS-upload-example/m-p/216921#M11287</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-04-19T18:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: Interpreting iOS upload example</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Interpreting-iOS-upload-example/m-p/217369#M11353</link>
      <description>&lt;P&gt;Thanks, that makes more sense now. &amp;nbsp;As for the other files, I'm figuring out URL's so that should work fine.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Apr 2017 05:12:14 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Interpreting-iOS-upload-example/m-p/217369#M11353</guid>
      <dc:creator>Vegepilot</dc:creator>
      <dc:date>2017-04-22T05:12:14Z</dc:date>
    </item>
  </channel>
</rss>

