none
Uploading to DropBox RRS feed

  • Question

  • Hi everyone,

    I have a windows application which creates approx 10 folders onto a server. Then i copy various files into these folders. My client would now like to use Dropbox instead!

    I've had a look around on various sites but cannot fathom out what code i actually need to use.

    If anyone can point me in the direction then that would be great.

    I have the App key/secret and username/password.

    Many thanks

    Simon

    Wednesday, August 21, 2019 1:17 PM

All replies

  • Best to look at the API and note there are not VB.NET code samples, only C# but should be easy to do a conversion.

    https://www.dropbox.com/developers/documentation/dotnet

    This should they respond to vb.net

    https://www.dropboxforum.com/t5/API-Support-Feedback/Vb-Net-can-upload-a-file-to-dropbox/td-p/330924


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange


    Wednesday, August 21, 2019 1:25 PM
    Moderator
  • Hi Karen,

    Thanks for your prompt reply.

    I shall take a look at this and give it a go. I have limited skills but like a challenge!

    Cheers

    Wednesday, August 21, 2019 2:36 PM
  • Hi,

    Do you resolve the issue? If you resolve the issue, please mark the helpful as answer. It will be beneficial to other community.If you have anything else about this issue, please feel free to contact us.

    Best Regards,

    Julie 


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, August 23, 2019 9:04 AM
    Moderator
  • Good afternoon,

    I have looked at your link but still struggling.

    The DropBox API is installed and i've used the following code to make a start but something seems to be missing.

    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 <token>") 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: " & response.StatusDescription) Else Console.WriteLine("FAILED: " & response.StatusDescription) End If Console.WriteLine(response.Content) End Sub

    Sorry, i'm no expert at this and believe it just needs fine tuning to work. Does this need to be within a Class??

    Thanks

    Simon

    Friday, September 13, 2019 12:14 PM