<?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: Vb.Net can upload a file to dropbox in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Vb-Net-can-upload-a-file-to-dropbox/m-p/723437#M31958</link>
    <description>&lt;P&gt;Imports System.IO&lt;BR /&gt;Imports RestSharp&lt;/P&gt;&lt;P&gt;Module Module1&lt;BR /&gt;Sub Main()&lt;BR /&gt;Dim sourceFile As String = "C:\Users\rw\Desktop\Proximus_logo.png"&lt;BR /&gt;Dim data As Byte() = File.ReadAllBytes(sourceFile)&lt;BR /&gt;Dim RestClient As RestClient = New RestClient("&lt;A href="https://content.dropboxapi.com/2/files/upload" target="_blank"&gt;https://content.dropboxapi.com/2/files/upload&lt;/A&gt;")&lt;BR /&gt;Dim request As RestRequest = New RestRequest(Method.POST)&lt;/P&gt;&lt;P&gt;request.AddHeader("Content-Type", "application/octet-stream")&lt;BR /&gt;request.AddHeader("Authorization", "Bearer &amp;lt;token&amp;gt;")&lt;/P&gt;&lt;P&gt;Dim meta As String = "{""path"": ""/home/proximus_logo.png"", ""mode"": ""add"", ""autorename"": true, ""mute"": false}"&lt;BR /&gt;request.AddHeader("Dropbox-API-Arg", meta)&lt;/P&gt;&lt;P&gt;request.AddParameter("application/octet-stream", data, ParameterType.RequestBody)&lt;/P&gt;&lt;P&gt;Dim response As IRestResponse = RestClient.Execute(request)&lt;/P&gt;&lt;P&gt;If response.IsSuccessful Then&lt;BR /&gt;Console.WriteLine("SUCCESS: " &amp;amp; response.StatusDescription)&lt;BR /&gt;Else&lt;BR /&gt;Console.WriteLine("FAILED: " &amp;amp; response.StatusDescription)&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;Console.WriteLine(response.Content)&lt;BR /&gt;End Sub&lt;BR /&gt;End Module&lt;/P&gt;</description>
    <pubDate>Sun, 22 Oct 2023 14:18:02 GMT</pubDate>
    <dc:creator>Mohanad1</dc:creator>
    <dc:date>2023-10-22T14:18:02Z</dc:date>
    <item>
      <title>Vb.Net can upload a file to dropbox</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Vb-Net-can-upload-a-file-to-dropbox/m-p/330924#M19339</link>
      <description>&lt;P&gt;Can you help me guys?&amp;nbsp;&lt;BR /&gt;Im trying to upload my first file to dropbox using vb.net. But Still have error: Status-Code:0, Content-type:0&lt;BR /&gt;My code below, can you correct me where do I do a mistake?&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; Public Sub Main()

        Dim sourceFile As String = "C:\Users\rw\Desktop\Proximus_logo.png"
        Dim data As Byte() = File.ReadAllBytes(sourceFile)
        Dim RestClient As RestClient = New RestClient("https://content.dropboxapi.com/2/files/upload")
        Dim request As IRestRequest = New RestRequest(Method.POST)


        request.AddHeader("Content-Type", "application/octet-stream")
        request.AddHeader("Authorization", "Bearer &amp;lt;token&amp;gt;")
        request.Parameters.Clear()
        Dim meta As String = "{\ path\:/home/proximus_logo.png \mode\: add \ strict_conflict\:false,\autorename\: true,\mute\: false}"


        request.AddHeader("Dropbox-API-Arg", meta)
        '  request.AddHeader("Content-Length", fileLength.ToString())

        '   request.AddParameter("path", "/home/proximus_logo.png")
        '   request.AddParameter("mode", "add")
        '   request.AddParameter("autorename", True)
        '   request.AddParameter("mute", False)
        '   request.AddParameter("strict_conflict", False)

        request.AddParameter("application/octet-stream", data, ParameterType.RequestBody)


        Dim response As RestResponse = RestClient.Execute(request)

        If response.IsSuccessful Then
            Console.WriteLine("SUCCESS: " &amp;amp; response.StatusDescription)
        Else
            Console.WriteLine("FAILED: " &amp;amp; response.StatusDescription)
        End If

        Console.WriteLine(response.Content)
    End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:07:46 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Vb-Net-can-upload-a-file-to-dropbox/m-p/330924#M19339</guid>
      <dc:creator>zap2it</dc:creator>
      <dc:date>2019-05-29T09:07:46Z</dc:date>
    </item>
    <item>
      <title>Re: Vb.Net can upload a file to dropbox</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Vb-Net-can-upload-a-file-to-dropbox/m-p/330994#M19344</link>
      <description>&lt;P&gt;Based on the output you shared, it looks like you're getting a status code of "0". That's not a real HTTP status code, however, so it looks like the HTTPS connection itself may not be succeeding. Is there any reason (e.g., proxy, firewall, security software, etc.) that you wouldn't be able to connect to&amp;nbsp;&lt;A href="https://content.dropboxapi.com" target="_blank"&gt;https://content.dropboxapi.com&lt;/A&gt;?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 18:17:33 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Vb-Net-can-upload-a-file-to-dropbox/m-p/330994#M19344</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2019-02-26T18:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: Vb.Net can upload a file to dropbox</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Vb-Net-can-upload-a-file-to-dropbox/m-p/331157#M19358</link>
      <description>&lt;P&gt;You were right, Thank you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I spend long hours solving this problem. It was a proxy problem.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2019 15:19:26 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Vb-Net-can-upload-a-file-to-dropbox/m-p/331157#M19358</guid>
      <dc:creator>zap2it</dc:creator>
      <dc:date>2019-02-27T15:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: Vb.Net can upload a file to dropbox</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Vb-Net-can-upload-a-file-to-dropbox/m-p/723437#M31958</link>
      <description>&lt;P&gt;Imports System.IO&lt;BR /&gt;Imports RestSharp&lt;/P&gt;&lt;P&gt;Module Module1&lt;BR /&gt;Sub Main()&lt;BR /&gt;Dim sourceFile As String = "C:\Users\rw\Desktop\Proximus_logo.png"&lt;BR /&gt;Dim data As Byte() = File.ReadAllBytes(sourceFile)&lt;BR /&gt;Dim RestClient As RestClient = New RestClient("&lt;A href="https://content.dropboxapi.com/2/files/upload" target="_blank"&gt;https://content.dropboxapi.com/2/files/upload&lt;/A&gt;")&lt;BR /&gt;Dim request As RestRequest = New RestRequest(Method.POST)&lt;/P&gt;&lt;P&gt;request.AddHeader("Content-Type", "application/octet-stream")&lt;BR /&gt;request.AddHeader("Authorization", "Bearer &amp;lt;token&amp;gt;")&lt;/P&gt;&lt;P&gt;Dim meta As String = "{""path"": ""/home/proximus_logo.png"", ""mode"": ""add"", ""autorename"": true, ""mute"": false}"&lt;BR /&gt;request.AddHeader("Dropbox-API-Arg", meta)&lt;/P&gt;&lt;P&gt;request.AddParameter("application/octet-stream", data, ParameterType.RequestBody)&lt;/P&gt;&lt;P&gt;Dim response As IRestResponse = RestClient.Execute(request)&lt;/P&gt;&lt;P&gt;If response.IsSuccessful Then&lt;BR /&gt;Console.WriteLine("SUCCESS: " &amp;amp; response.StatusDescription)&lt;BR /&gt;Else&lt;BR /&gt;Console.WriteLine("FAILED: " &amp;amp; response.StatusDescription)&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;Console.WriteLine(response.Content)&lt;BR /&gt;End Sub&lt;BR /&gt;End Module&lt;/P&gt;</description>
      <pubDate>Sun, 22 Oct 2023 14:18:02 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Vb-Net-can-upload-a-file-to-dropbox/m-p/723437#M31958</guid>
      <dc:creator>Mohanad1</dc:creator>
      <dc:date>2023-10-22T14:18:02Z</dc:date>
    </item>
  </channel>
</rss>

