Need crash course in Dropbox library

Mike Kerner MikeKerner at roadrunner.com
Sun Feb 17 19:16:45 EST 2019


Hey pink
Yes, you are just going to put 150MB at a time into the pData parameter and
ship it.
I have not uploaded any binary files, just encoded text files, so you may
have to fiddle with encoding to make sure you don't get into any trouble.
You should be able to open/read the files using
put url "binfile:/"&somefilename into fileContents

On Sun, Feb 17, 2019 at 10:42 AM pink via use-livecode <
use-livecode at lists.runrev.com> wrote:

> the phxDropbox library is for v1 of the Dropbox API, which has been
> deprecated
>
> what I need is to get a handle of the upload session commands, how do I
> properly break the file data into seperate sessions, and how do i determine
> the offset value
>
>
> Matthias Rebbe via use-livecode wrote
> > Don't know if this works anymore but before i used this:
> >
> >
> > *on*openstack
> >
> > *if* thereisnotastack"phxDropboxLib"*then*
> >
> > *put*GetPathToFile("phxDropboxLib.livecode") intophxLib
> >
> > *start*usingstackphxLib
> >
> > *else* *if* "phxDropboxLib"isnotamongthelinesofthestacksinuse*then*
> >
> > *start*usingstack"phxDropboxLib"
> >
> > *end* *if*
> >
> > *--*
> >
> > *if* "phxDropboxLib"isnotamongthelinesofthestacksinuse*then*
> >
> > *answer*error"Unable to load phxDropboxLib"
> >
> > *quit*
> >
> > *end* *if*
> >
> > *constant*myAppKey = "appappappapp"
> >
> > *constant*myAppSec = "secsecsec"
> >
> > *constant*myTokKey = "toktoktoktok"
> >
> > *constant*myTokSec = "sectoksectok"
> >
> > *--*
> >
> > *if* notphx_DropboxAvailable() *then*
> >
> > *answer*"Dropbox HTTPS connection NOT available"
> >
> > *end* *if*
> >
> > *get*phx_DropboxInitLib(myAppKey, myAppSec, myTokKey, myTokSec)
> >
> > end openCard
> >
> > ----reading----
> >
> > *put*phx_DropboxReadFile("sandbox", ("/folder/some.txt"))
> > intoField"Name1"ofcard1
> >
> > ----writing------
> >
> > *put*phx_DropboxWriteFile("sandbox", ("/folder/some.txt"), "text/html",
> > true, myName) intofield"udontcme"ofcard1
> >
> > ------close-----------
> >
> > *on*closeStack
> >
> > *set*theuTokenKey ofthisstacktoempty
> >
> > *set*theuTokenSec ofthisstacktoempty
> >
> > *stop*usingstack"phxDropboxLib"
> >
> > *close*stack"phxDropboxLib"
> >
> > *pass*closeStack
> >
> > *end*closeStack
> >
> > Op 16-2-2019 om 00:23 schreef pink via use-livecode:
> >> under the documentation for dropboxUpload,  it states it shouldn't be
> >> used
> >> for files larger than 150MB, the video files will all be around 800MB
> >>
> >> I've been looking through the stack, but cannot find the answers I am
> >> looking for. SO I am still not clear how I should get my file into pData
> >>
> >> and pData is just a chunk of the data? How do I make that chunk out of
> >> the
> >> whole and where do I get pOffset from?
> >>
> >>
> >> Matthias Rebbe via use-livecode wrote
> >>> Hey, pink, thanks for the clarification.
> >>> First of all, is there a reason why you are doing it this way instead
> of
> >>> using dropboxUpload?  If you use dropboxUpload you can do it all in one
> >>> shot.
> >>> Gerard's stack explains the process and how to use the various commands
> >>> Doing it the way you are doing it, you would start with sessionStart
> and
> >>> then you would repeatedly call sessionAppend
> >>> pOffset is the length of what you have already sent because there are
> no
> >>> guarantees that dropbox will get your file stream in order, so if it
> >>> gets
> >>> them out of order and pData isn't the same length for each call to
> >>> append,
> >>> the only way dropbox knows where to put the data it just received is if
> >>> you
> >>> tell it where to put it.
> >>> pData should be at most 150mb per call.
> >>> _______________________________________________
> >>> use-livecode mailing list
> >>> use-livecode at .runrev
> >>> Please visit this url to subscribe, unsubscribe and manage your
> >>> subscription preferences:
> >>> http://lists.runrev.com/mailman/listinfo/use-livecode
> >>
> >>
> >>
> >>
> >> -----
> >> ---
> >> Greg (pink) Miller
> >> mad, pink and dangerous to code
> >> --
> >> Sent from:
> >>
> http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html
> >>
> >> _______________________________________________
> >> use-livecode mailing list
> >>
>
> > use-livecode at .runrev
>
> >> Please visit this url to subscribe, unsubscribe and manage your
> >> subscription preferences:
> >> http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> > _______________________________________________
> > use-livecode mailing list
>
> > use-livecode at .runrev
>
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
>
>
>
> -----
> ---
> Greg (pink) Miller
> mad, pink and dangerous to code
> --
> Sent from:
> http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."



More information about the Use-livecode mailing list