NetTalk Central

Author Topic: Posting to Dropbox  (Read 3142 times)

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Posting to Dropbox
« on: July 12, 2021, 12:34:35 PM »
To upload a file to Dropbox using CURL:

curl -X POST https://content.dropboxapi.com/2/files/upload
--header "Authorization: Bearer TuToken"
--header "Dropbox-API-Arg: {\"path\": \"/Test.txt\"}"
--header "Content-Type: application/octet-stream"
--data-binary @Test.txt

No problem with the header but...
How to set the --data-binary @Test.txt in NT?

Im trying to use this instaed of NetDrive because I did not found a way to use it with a fixed Token
Besides... using CURL you can generate the file hyperlink, using:
curl -X POST https://api.dropboxapi.com/2/sharing/create_shared_link_with_settings --header "Authorization: Bearer TuToken" --header "Content-Type: application/json"  --data "{\"path\": \"/Test.pdf\",\"settings\": {\"requested_visibility\": \"public\"}}" > SharedHyperlink.Json

Thanks



« Last Edit: July 13, 2021, 04:15:15 AM by michelis »
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Posting to Dropbox
« Reply #1 on: July 13, 2021, 07:52:24 PM »
--data-binary @Test.txt

This is just the "postdata" part of the net web client. So use

  net.post(url,str)

where str is a stringTheory object containing the binary data you want to send (presumably the contents of a file, you loaded into str with str.loadfile)

Cheers
Bruce