Page 1 of 1

mergDropBoxDownload error

Posted: Tue Jun 20, 2017 6:28 pm
by simon.schvartzman
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

Re: mergDropBoxDownload error

Posted: Tue Jun 20, 2017 6:43 pm
by Klaus
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

Re: mergDropBoxDownload error

Posted: Tue Jun 20, 2017 6:54 pm
by simon.schvartzman
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

Re: mergDropBoxDownload error

Posted: Tue Jun 20, 2017 8:33 pm
by Klaus
Sorry, no more ideas...

Re: mergDropBoxDownload error

Posted: Tue Jun 20, 2017 9:01 pm
by simon.schvartzman
Thanks anyway.

Re: mergDropBoxDownload error

Posted: Wed Jun 21, 2017 2:13 pm
by Mikey
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

SOLVED: mergDropBoxDownload error

Posted: Wed Jun 21, 2017 8:07 pm
by simon.schvartzman
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