mergDropBoxDownload error

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

mergDropBoxDownload error

Post by simon.schvartzman » Tue Jun 20, 2017 6:28 pm

Hi team, I'm trying to download a file from Dropbox to my iOs Device.

Once my App is properly linked to Dropbox I execute the following code

Code: Select all

   put "/201706200929.jpg" into pDropboxPath
   put "/" into pLocalPath  
   try
      mergDropboxDownload pDropboxPath, pLocalPath
   catch e
      answer e
   end try 
and I get the following error:
IMG_0001.PNG
Comments:
- I receive the error even the first time that I run the App
- After trying to Download the file the storage used by my App increases at about the same size as the actual file
- when I list the files in my App directory the file isn't there

Will appreciate if somebody can point out what am I doing wrong or as an option share with me a working example of mergDropboxDownload.

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

Klaus
Posts: 14208
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: mergDropBoxDownload error

Post by Klaus » Tue Jun 20, 2017 6:43 pm

Hi Simon,

acording to the dictionary you need to supply a FULL local path:
...
pLocalPath - the full local path to download the file to
...
So the SLASH probably points to a folder INSIDE of the app bundle where you do not have write permission!

Try this:

Code: Select all

...
put "/201706200929.jpg" into pDropboxPath
put specialfolderpath("documents") & "/" into pLocalPath  
   try
   mergDropboxDownload pDropboxPath, pLocalPath
   catch e
      answer e
   end try
...
Best

Klaus

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

Re: mergDropBoxDownload error

Post by simon.schvartzman » Tue Jun 20, 2017 6:54 pm

Klaus, many thanks for your prompt answer and useful hints as ever.

The error message has changed slightly but still not file downloaded.
IMG_0002.PNG
Simon
________________________________________
To ";" or not to ";" that is the question

Klaus
Posts: 14208
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: mergDropBoxDownload error

Post by Klaus » Tue Jun 20, 2017 8:33 pm

Sorry, no more ideas...

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

Re: mergDropBoxDownload error

Post by simon.schvartzman » Tue Jun 20, 2017 9:01 pm

Thanks anyway.
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: mergDropBoxDownload error

Post by Mikey » Wed Jun 21, 2017 2:13 pm

Simon,
I can share Monte's sample stack that goes with the external, if you like, but I am pretty sure that the mergDropbox external uses v1 of the Dropbox API, which is deprecated and scheduled to be turned off at the end of the month. You have other options to move to the v2 API. I have discussed those here http://forums.livecode.com/viewtopic.php?f=9&t=29377

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

SOLVED: mergDropBoxDownload error

Post by simon.schvartzman » Wed Jun 21, 2017 8:07 pm

Just to close the post, thanks to Mikey helps I found the error and the working code is as follows

Code: Select all

  put "/201706200929.jpg" into pDropboxPath
   put the documents folder&pDropboxPath into pLocalPath 
   try
      mergDropboxDownload pDropboxPath, pLocalPath
   catch e
      answer e
   end try 
Simon
________________________________________
To ";" or not to ";" that is the question

Post Reply