Dropbox upload with HTTP request

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
simon.schvartzman
Posts: 665
Joined: Tue Jul 29, 2014 12:52 am

Dropbox upload with HTTP request

Post by simon.schvartzman » Sat Feb 11, 2017 9:46 pm

Searching the Dropbox site I found this link https://dropbox.github.io/dropbox-api-v ... pha/upload which with a user friendly interface builds and API request and shows how the HTTP request code should be

In my case, in order to be able to upload an image file I get this
POST /2/files/alpha/upload
Host: https://content.dropboxapi.com
User-Agent: api-explorer-client
Authorization: Bearer thetokengivenatthetopofthepage
Content-Type: application/octet-stream
Dropbox-API-Arg: {"path":"/home/Test.jpg","mode":{".tag":"add"}}
Content-Length: 625514

--- (content of IMG_0456.JPG goes here) ---
How can I build this HTTP request using LC? I'm not clear as what I have to remove, how to concatenate the different parts and how to include the IMG_0456.JPG contents.

I guess this could be very useful to other users if it runs OK.

Thanks...
Simon
________________________________________
To ";" or not to ";" that is the question

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 755
Joined: Fri Jun 27, 2008 9:00 pm

Re: Dropbox upload with HTTP request

Post by Mikey » Sun Feb 12, 2017 3:42 pm

There are three different Dropbox libraries for LC. There is the mergdropbox external, the phx_dropboxLib, and the i think the other is called Dropbox_v2 or something like that. All three wrap the Dropbox API for use in LC.

Post Reply