122 posts
Location
gps.locate()
Posted 22 July 2015 - 05:55 PM
Hi,
I have already made a program that is able to download/run programs from Dropbox, but I am now wondering how I then upload them to Dropbox, much like the Pastebin app.
Any help will be appreciated,
ZiR
3057 posts
Location
United States of America
Posted 22 July 2015 - 06:01 PM
Perhaps
the dropbox api would help you. I've linked to the PUT section, which should allow you to upload files.
122 posts
Location
gps.locate()
Posted 22 July 2015 - 06:43 PM
Okay, I am starting to code it now but the part I don't get is the 'request body'…
Any explanation / sample code would be appreciated..
ZiR
3057 posts
Location
United States of America
Posted 22 July 2015 - 06:50 PM
I'm not familiar with using the http api beyond interacting with github or pastebin.
However, I think it refers to the postData parameter from
http.post.
1140 posts
Location
Kaunas, Lithuania
Posted 22 July 2015 - 06:51 PM
It's the second parameter for http.post. It simply should be a string containing the file contents. You'll also have to set the 'content-length' header to the length of the file contents.
3057 posts
Location
United States of America
Posted 22 July 2015 - 06:52 PM
You'll also have to set the 'content-length' header to the length of the file contents.
Actually, I believe that's optional.Nevermind I'm just stupid
Edited on 22 July 2015 - 04:53 PM
122 posts
Location
gps.locate()
Posted 22 July 2015 - 07:02 PM
Okay, I've scrapped the idea of posting to Dropbox. I will just download the files on startup so that then I will remember to edit them through Dropbox.
But, thanks for your help nonetheless.
ZiR