<?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 Uploaded ZIP file is corrupted in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Uploaded-ZIP-file-is-corrupted/m-p/232307#M12664</link>
    <description>&lt;P&gt;After uploading a compressed ZIP file cannot be opened by the 7Zip or WinZip program on my desktop PC. I can open the original file but after I upload it using the sample code below, the file is about 90KB larger and corrupted.&amp;nbsp; Does anyone know what I am doing wrong?&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;cj51&lt;/P&gt;&lt;P&gt;---------------------SAMPLE VBA CODE-----------------------&lt;/P&gt;&lt;P&gt;Function ReadBinary(sFile As String) As Byte()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim nFile&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; As Integer&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ReadBinary = ""&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; nFile = FreeFile&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Open sFile For Binary Access Read As #nFile&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If LOF(nFile) &amp;gt; 0 Then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ReDim ReadBinary(0 To LOF(nFile) - 1)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Get nFile, , ReadBinary&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Close #nFile&lt;BR /&gt;End Function&lt;BR /&gt;------------------ API SYNTAX STARTS HERE ---------------&lt;BR /&gt;strFile = ReadBinary(FileName)&lt;BR /&gt;arg = "{""path"":" &amp;amp; DQ &amp;amp; "/File requests/StatusLog/" &amp;amp; DropBox_FileName &amp;amp; DQ &amp;amp; "," &amp;amp; &amp;nbsp;&amp;nbsp; &amp;nbsp;"""mode"":""overwrite"",""autorename"": true,""mute"":true}"&lt;BR /&gt;&lt;BR /&gt;req.Open "POST", "&lt;A href="https://content.dropboxapi.com/2/files/upload" target="_blank"&gt;https://content.dropboxapi.com/2/files/upload&lt;/A&gt;", False&lt;BR /&gt;req.setRequestHeader "Authorization", "Bearer &amp;lt;yadayada"&lt;BR /&gt;req.setRequestHeader "Content-Type", "application/octet-stream"&lt;BR /&gt;req.setRequestHeader "Content-length", Len(strFile)&lt;BR /&gt;req.setRequestHeader "Dropbox-API-Arg", arg&lt;BR /&gt;req.setRequestHeader "User-Agent", "api-explorer-client"&lt;BR /&gt;req.send strFile&lt;/P&gt;</description>
    <pubDate>Wed, 29 May 2019 09:20:45 GMT</pubDate>
    <dc:creator>cj51</dc:creator>
    <dc:date>2019-05-29T09:20:45Z</dc:date>
    <item>
      <title>Uploaded ZIP file is corrupted</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Uploaded-ZIP-file-is-corrupted/m-p/232307#M12664</link>
      <description>&lt;P&gt;After uploading a compressed ZIP file cannot be opened by the 7Zip or WinZip program on my desktop PC. I can open the original file but after I upload it using the sample code below, the file is about 90KB larger and corrupted.&amp;nbsp; Does anyone know what I am doing wrong?&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;cj51&lt;/P&gt;&lt;P&gt;---------------------SAMPLE VBA CODE-----------------------&lt;/P&gt;&lt;P&gt;Function ReadBinary(sFile As String) As Byte()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim nFile&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; As Integer&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ReadBinary = ""&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; nFile = FreeFile&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Open sFile For Binary Access Read As #nFile&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If LOF(nFile) &amp;gt; 0 Then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ReDim ReadBinary(0 To LOF(nFile) - 1)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Get nFile, , ReadBinary&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Close #nFile&lt;BR /&gt;End Function&lt;BR /&gt;------------------ API SYNTAX STARTS HERE ---------------&lt;BR /&gt;strFile = ReadBinary(FileName)&lt;BR /&gt;arg = "{""path"":" &amp;amp; DQ &amp;amp; "/File requests/StatusLog/" &amp;amp; DropBox_FileName &amp;amp; DQ &amp;amp; "," &amp;amp; &amp;nbsp;&amp;nbsp; &amp;nbsp;"""mode"":""overwrite"",""autorename"": true,""mute"":true}"&lt;BR /&gt;&lt;BR /&gt;req.Open "POST", "&lt;A href="https://content.dropboxapi.com/2/files/upload" target="_blank"&gt;https://content.dropboxapi.com/2/files/upload&lt;/A&gt;", False&lt;BR /&gt;req.setRequestHeader "Authorization", "Bearer &amp;lt;yadayada"&lt;BR /&gt;req.setRequestHeader "Content-Type", "application/octet-stream"&lt;BR /&gt;req.setRequestHeader "Content-length", Len(strFile)&lt;BR /&gt;req.setRequestHeader "Dropbox-API-Arg", arg&lt;BR /&gt;req.setRequestHeader "User-Agent", "api-explorer-client"&lt;BR /&gt;req.send strFile&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:20:45 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Uploaded-ZIP-file-is-corrupted/m-p/232307#M12664</guid>
      <dc:creator>cj51</dc:creator>
      <dc:date>2019-05-29T09:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: Uploaded ZIP file is corrupted</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Uploaded-ZIP-file-is-corrupted/m-p/232358#M12665</link>
      <description>&lt;P&gt;PROBLEM SOLVED! -&amp;nbsp; I replaced the send strFile with send ReadBinary function, deleted the strFile = ReadBinnary line and replaced the Len(strFile) with FileLen("NAME OF INPUT FILE').&amp;nbsp; This issue can be closed.&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jul 2017 03:15:54 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Uploaded-ZIP-file-is-corrupted/m-p/232358#M12665</guid>
      <dc:creator>cj51</dc:creator>
      <dc:date>2017-07-15T03:15:54Z</dc:date>
    </item>
  </channel>
</rss>

