Dropbox Livecode Library
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 281
- Joined: Sat Jun 04, 2011 5:41 pm
- Location: Switzerland
Re: Dropbox Livecode Library
Ops ... in the previous post I linked an incorrect versions of the library. Thanks to Mike for reporting
Enclosed the correct one ... I hope
Guglielmo
Enclosed the correct one ... I hope
Guglielmo
- Attachments
-
- phxDropboxLib.zip
- (14.37 KiB) Downloaded 365 times
Re: Dropbox Livecode Library
All,
Another tweak to fix a typo, taking us to v. 1.11.
I am now maintaining all of this at
https://github.com/macMikey/phxDropboxLib
Note that in the phxdropboxlib folder there is a script file (plaintext), and another phxdropboxlib, which is the stack/documentation distribution folder.
Another tweak to fix a typo, taking us to v. 1.11.
I am now maintaining all of this at
https://github.com/macMikey/phxDropboxLib
Note that in the phxdropboxlib folder there is a script file (plaintext), and another phxdropboxlib, which is the stack/documentation distribution folder.
Last edited by Mikey on Thu Jun 09, 2016 9:21 pm, edited 1 time in total.
Re: Dropbox Livecode Library
Thanks for sharing!
Re: Dropbox Livecode Library
NOTE: There was a change in the way dropbox is handling error messages, so v. 1.12 is now up on github...
Re: Dropbox Livecode Library
thx for the update!
Re: Dropbox Livecode Library
Great library. Thank you very much Guglielmo and others.
Is it possible to upload and download stacks and other kind of files to DropBox using this library?
I tried using "application/octet-stream" for the file type but the only thing that happens is creating a text file with the chosen file path text in it.
Thanks
Is it possible to upload and download stacks and other kind of files to DropBox using this library?
I tried using "application/octet-stream" for the file type but the only thing that happens is creating a text file with the chosen file path text in it.
Thanks
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>
Re: Dropbox Livecode Library
Yes, it sure is. Make sure you base64convert the files going up, and reverse it coming back. You have to read the contents of the file, encode it, then send that to db, using the library. I don't remember there being a "copy file" function in the library.
Re: Dropbox Livecode Library
Thanks for the fast response.
I think you meant something like this:
and this
Do you think data should be encrypted or checkout for integrity and security ? And how?
May be using the md5Digest function.. but I wouldn't know how to use it. Any help?
Thanks again
I think you meant something like this:
Code: Select all
on mouseUp
-- upload
if (the uTokenKey of this stack) is empty then
exit mouseUp
end if
put empty into field "flAnswer"
answer file "Choose a file to upload" --the name of the file is "ProvaBeep.livecode"
if it is empty then exit mouseup
set the itemdelimiter to slash
put last item of it into tname
put URL ("binfile:" & it) into tFile
put base64Encode(tFile) into tFile
put phx_DropboxWriteFile("sandbox", tname, "application/octet-stream", true, tFile) into field "flAnswer"
end mouseUp
Code: Select all
on mouseUp
-- download
if (the uTokenKey of this stack) is empty then
exit mouseUp
end if
put empty into field "flAnswer"
put phx_DropboxReadFile("sandbox", "ProvaBeep.livecode") into tFile
if "Err: " is in tFile then
put tFile into field "flAnswer"
exit mouseup
end if
set the defaultFolder to specialFolderPath("desktop")
ask File "Save the file:" with "ProvaBeep.livecode"
if it is not empty then
put base64Decode(tFile) into URL ("binfile:" & it)
end if
end mouseUp
May be using the md5Digest function.. but I wouldn't know how to use it. Any help?
Thanks again
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>
Re: Dropbox Livecode Library
I normally encrypt everything. The md5digest is just a checksum. You can keep that to ensure that the file has not changed, but you can't use it to fix a file that has.
Re: Dropbox Livecode Library
Hi Guys,
it seems like this great library is becoming obsolete....if i'm correct.
look at the images on this page https://livecode.com/cross-platform-app ... en-easier/
It looks like to be included in lc8.1
cheers,
Sphere
it seems like this great library is becoming obsolete....if i'm correct.
look at the images on this page https://livecode.com/cross-platform-app ... en-easier/
It looks like to be included in lc8.1
cheers,
Sphere
Re: Dropbox Livecode Library
Mergdropbox is only for iOS.
Re: Dropbox Livecode Library
Ah yes i've overseen that
Re: Dropbox Livecode Library
This library is fantastic. Thank you very much indeed.
I have a problem downloading several files in a row.
I have around 10 300KB-2MG mp4 files, that works fine both manually copying it from DropBox or on the DropBox folder (MacOSX 10.10.5 LC7.4.1)
But when I download them with the library, some files get saved as 0KB (no icon either). And the library doesn't report any error.
My code is something like this:
I don't get any error report (with the Try End Try)
With few file repetitions I don't have this problem.
Any help is appreciated. Thanks
Trevix
I have a problem downloading several files in a row.
I have around 10 300KB-2MG mp4 files, that works fine both manually copying it from DropBox or on the DropBox folder (MacOSX 10.10.5 LC7.4.1)
But when I download them with the library, some files get saved as 0KB (no icon either). And the library doesn't report any error.
My code is something like this:
Code: Select all
repeat
...
put Drop_Download(tPAthFrom, tPathTo)
..
end repeat
function Drop_Download pPAthFrom, pPathTo
if (the uTokenKey of stack "phxDropboxLib") is empty then
return "Err: not authorized"
end if
--the actual download
put phx_DropboxReadFile("sandbox", pPAthFrom) into tFile
--tFile AT THIS POINT HAS DATA INTO IT (PROBABLY NOT WELL FORMATTED?)
if "Err: " is in tFile then
return tFile
end if
if "can't open file" is in tFile then
return "Err: " & tFile
end if
if pPathTo is not empty then
try
put base64Decode(tFile) into URL ("binfile:" & pPathTo)
catch tErr
answer tErr
end try
end if
end Drop_Download
With few file repetitions I don't have this problem.
Any help is appreciated. Thanks
Trevix
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>
Re: Dropbox Livecode Library
I found the problem. Not the solution or the reason why...
If I upload the video using the library (MIME "video/mp4" or "application/octet-stream"), then the download, using the library, is fine.
If I upload the video in the Finder, dragging the video file to the dropbox folder, then the download won't work.
Note that in this last case the video will hold its icon and finder info, while uploading it with the library (MIME "video/mp4" or "application/octet-stream") the icon turns into generic and the finder info are lost.
If I upload the video using the library (MIME "video/mp4" or "application/octet-stream"), then the download, using the library, is fine.
If I upload the video in the Finder, dragging the video file to the dropbox folder, then the download won't work.
Note that in this last case the video will hold its icon and finder info, while uploading it with the library (MIME "video/mp4" or "application/octet-stream") the icon turns into generic and the finder info are lost.
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>
Re: Dropbox Livecode Library
Also there is a problem with capitalized chars in path
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>