Re: Need crash course in Dropbox library

2019-02-19 Thread pink via use-livecode
I still need to do some testing and fiddle with a few things, but here's what
I've got so far, authentication is handled in a different handler, the
access token is passed as a parameter:

command dropBoxUploader pAccessToken
   local tMyFolder = "/Downloads"
   local tMyFileShortFilename = "abc.mp4"
   local tMyFilePath = "/Downloads/abc.mp4"
   local tChunkSize = 157286400
   local tStep = 0
   local tBytesProcessed = 0
   local tOffset = 0
   local tDestPath = "/somefolder/abc.mp4"
   local tFileDescription, tBytesRemaining, tBytesThisRead, tResult,
tSession
   
   filter files(tMyFolder, "detailed") with tMyFileShortFilename & ",*" 
into tFileDescription 
   put item 2 of tFileDescription into tBytesRemaining 
   put tChunkSize into tBytesThisRead 
   open file tMyFilePath for binary read 
   repeat until tBytesRemaining = 0 
  read from file tMyFilePath for tBytesThisRead 
  put it into tData
  subtract length(tData) from tBytesRemaining 
  add 1 to tStep
  if tStep = 1 then
 dropboxUploadSessionStart pAccessToken, tData 
  else if tBytesRemaining = 0 then
 dropboxUploadSessionFinish pAccessToken, tSession, tOffset,
tDestPath, "add", true,  false, tData
  else
 dropboxUploadSessionAppend pAccessToken, tSession, tOffset, tData 
  end if
  put jsonToArray(the result) into tResult[tStep]
  if tResult[tStep]["error"] is not empty then
 exit repeat
  end if
  put tResult[1]["session_id"] into tSession
  add tBytesThisRead to tOffset
  put min(tChunkSize, tBytesRemaining) into tBytesThisRead 
   end repeat 
   close file tMyFilePath 
end dropBoxUploader


JJS via use-livecode wrote
> I'm not sure how this would work in your context, but one way to break 
> up a file into pieces is to use open / read / close like this:
> 
> # assumes LC 9.0.2
> # tMyFolder = path of folder containing the file to upload
> # tMyFileShortFilename = 'short' filename of file to upload - no
> path, just the filename
> # tMyFilePath = full path of file to upload
> 
> filter files(tMyFolder, "detailed") with tMyFileShortFilename & ",*"
> into tFileDescription
> put item 2 of tFileDescription into tBytesRemaining
> put 0 into tBytesProcessed
> put 157286400 into tChunkSize -- 150 MB
> put tChunkSize into tBytesThisRead
> open file tMyFilePath for binary read
> repeat until tBytesRemaining = 0
>      read from file tMyFilePath for tBytesThisRead
>      subtract length(it) from tBytesRemaining
>      _processChunk it
>      put min(tChunkSize, tBytesRemaining) into tBytesThisRead
> end repeat
> close file tMyFilePath
> 
> Your upload would be done in the '_processChunk' handler.
> 
> HTH -
> Phil Davis
> 
> 
> On 2/18/19 5:21 AM, pink via use-livecode wrote:
>> I'm getting a little closer...
>>
>> 1. how do I break fileContents into smaller pieces?
>> 2. how do I properly calculate the pOffset value?
>>
>>
>> Matthias Rebbe via use-livecode wrote
>>> 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:/" into fileContents
>>>
>>> On Sun, Feb 17, 2019 at 10:42 AM pink via use-livecode <
>>> use-livecode@.runrev
 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

Re: Need crash course in Dropbox library

2019-02-18 Thread Phil Davis via use-livecode
I'm not sure how this would work in your context, but one way to break 
up a file into pieces is to use open / read / close like this:


   # assumes LC 9.0.2
   # tMyFolder = path of folder containing the file to upload
   # tMyFileShortFilename = 'short' filename of file to upload - no
   path, just the filename
   # tMyFilePath = full path of file to upload

   filter files(tMyFolder, "detailed") with tMyFileShortFilename & ",*"
   into tFileDescription
   put item 2 of tFileDescription into tBytesRemaining
   put 0 into tBytesProcessed
   put 157286400 into tChunkSize -- 150 MB
   put tChunkSize into tBytesThisRead
   open file tMyFilePath for binary read
   repeat until tBytesRemaining = 0
    read from file tMyFilePath for tBytesThisRead
    subtract length(it) from tBytesRemaining
    _processChunk it
    put min(tChunkSize, tBytesRemaining) into tBytesThisRead
   end repeat
   close file tMyFilePath

Your upload would be done in the '_processChunk' handler.

HTH -
Phil Davis


On 2/18/19 5:21 AM, pink via use-livecode wrote:

I'm getting a little closer...

1. how do I break fileContents into smaller pieces?
2. how do I properly calculate the pOffset value?


Matthias Rebbe via use-livecode wrote

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:/" into fileContents

On Sun, Feb 17, 2019 at 10:42 AM pink via use-livecode <
use-livecode@.runrev

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@.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@.runrev

Please visit this url to subscribe, unsubscribe and manage your
subscription 

Re: Need crash course in Dropbox library

2019-02-18 Thread pink via use-livecode
I'm getting a little closer...

1. how do I break fileContents into smaller pieces?
2. how do I properly calculate the pOffset value?


Matthias Rebbe via use-livecode wrote
> 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:/" into fileContents
> 
> On Sun, Feb 17, 2019 at 10:42 AM pink via use-livecode <

> use-livecode@.runrev

>> 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@.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@.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@.runrev
>>
>> > Please visit this url to subscribe, unsubscribe and manage your
>> > subscription preferences:
>> > 

Re: Need crash course in Dropbox library

2019-02-17 Thread Mike Kerner via use-livecode
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:/" into fileContents

On Sun, Feb 17, 2019 at 10:42 AM pink via use-livecode <
use-livecode@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@.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@.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@.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@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage 

Re: Need crash course in Dropbox library

2019-02-17 Thread pink via use-livecode
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@.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@.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@.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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Need crash course in Dropbox library

2019-02-16 Thread JJS via use-livecode

ah yes, thanks Mark.

Op 16-2-2019 om 18:01 schreef Mark Wieder via use-livecode:

On 2/16/19 6:24 AM, JJS via use-livecode wrote:

please ignore the *, that's a copy/paste issue from lc to thunderbird


To solve this in thunderbird:

Open the Address Book
If you don't already have an entry for the use-list, create one
Right-click on the entry in the address book
Select "Edit Contact"
For "Prefers to receive messages formatted as:"
Select "Plain Text"

problem solved.

Alternate methods:

Select "Account Settings" from the Edit menu
Select "Composition & Addressing"
Uncheck "Compose messages in HTML format"

Select Preferences from the Edit menu
Select the Composition tab
Select the General tab
Click the "Send Options..." button
Check "Send messages as plain text if possible"



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Need crash course in Dropbox library

2019-02-16 Thread Mark Wieder via use-livecode

On 2/16/19 6:24 AM, JJS via use-livecode wrote:

please ignore the *, that's a copy/paste issue from lc to thunderbird


To solve this in thunderbird:

Open the Address Book
If you don't already have an entry for the use-list, create one
Right-click on the entry in the address book
Select "Edit Contact"
For "Prefers to receive messages formatted as:"
Select "Plain Text"

problem solved.

Alternate methods:

Select "Account Settings" from the Edit menu
Select "Composition & Addressing"
Uncheck "Compose messages in HTML format"

Select Preferences from the Edit menu
Select the Composition tab
Select the General tab
Click the "Send Options..." button
Check "Send messages as plain text if possible"

--
 Mark Wieder
 ahsoftw...@gmail.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Need crash course in Dropbox library

2019-02-16 Thread JJS via use-livecode

please ignore the *, that's a copy/paste issue from lc to thunderbird

Op 16-2-2019 om 15:21 schreef JJS via use-livecode:

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@.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@lists.runrev.com
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@lists.runrev.com
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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Need crash course in Dropbox library

2019-02-16 Thread JJS via use-livecode

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@.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@lists.runrev.com
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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Need crash course in Dropbox library

2019-02-15 Thread 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@.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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Need crash course in Dropbox library

2019-02-15 Thread Mike Kerner via use-livecode
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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Need crash course in Dropbox library

2019-02-15 Thread pink via use-livecode
Unfortunately, looking at the other library isn't making things clearer...

Let me get more specific, here are the main commands I'm trying to learn:

dropboxUploadSessionStart pAccessToken, pData
dropboxUploadSessionAppend pAccessToken, pSession, pOffset, pData
dropboxUploadSessionFinish pAccessToken, pSession, pOffset, pPath, pMode,
pAutorename, pMute, pData

I understand how to get the access token, and how to get the sessionID
but...

1. what do I put into pData? I assume pData is the file I am supposed to be
uploading, but how do I put it in there? do I just open file, then read from
file and then put it into pData?
2. do i just use the same value for pData in all commands?
3. Where do I get the pOffset value?
4. Do I control how much data is sent with each request? If so, how? If not,
how do I know how many append sessions to use before I send the finish?




Matthias Rebbe via use-livecode wrote
> Then I would suggest
> Grab Gerard's LC dropbox v2 goodies that are at
> https://github.com/macMikey/dropboxapi_v2
> The LC dropbox library was "inspired by" Gerard's library.  The command
> names are different, but I'm pretty sure it's one-to-one and I'm pretty
> sure the syntax is identical.  Where it isn't (or where a return value
> didn't correlate) I'm pretty sure I submitted PR's to LC's library to fix
> theirs, and I'm pretty sure all the PR's have been integrated.
> One thing that is different/better with LC's library is that LC's library
> adds optional support for asynchronous calls if you have one of the
> not-free LC versions.
> Gerard's library also has a tester built in, which is helpful for
> debugging
> purposes.  When you have the syntax right, switch the calls to the LC
> library.
> If you still need help check back here and we'll see what else you might
> need.
> 
> On Thu, Feb 14, 2019 at 8:24 PM pink via use-livecode <

> use-livecode@.runrev

>> wrote:
> 
>> was planning on using the LC Dropbox library
>>
>>
>>
>> -
>> ---
>> 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@.runrev

>> 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."
> ___
> use-livecode mailing list

> use-livecode@.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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Need crash course in Dropbox library

2019-02-15 Thread Mike Kerner via use-livecode
Then I would suggest
Grab Gerard's LC dropbox v2 goodies that are at
https://github.com/macMikey/dropboxapi_v2
The LC dropbox library was "inspired by" Gerard's library.  The command
names are different, but I'm pretty sure it's one-to-one and I'm pretty
sure the syntax is identical.  Where it isn't (or where a return value
didn't correlate) I'm pretty sure I submitted PR's to LC's library to fix
theirs, and I'm pretty sure all the PR's have been integrated.
One thing that is different/better with LC's library is that LC's library
adds optional support for asynchronous calls if you have one of the
not-free LC versions.
Gerard's library also has a tester built in, which is helpful for debugging
purposes.  When you have the syntax right, switch the calls to the LC
library.
If you still need help check back here and we'll see what else you might
need.

On Thu, Feb 14, 2019 at 8:24 PM pink via use-livecode <
use-livecode@lists.runrev.com> wrote:

> was planning on using the LC Dropbox library
>
>
>
> -
> ---
> 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@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."
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Need crash course in Dropbox library

2019-02-14 Thread pink via use-livecode
was planning on using the LC Dropbox library



-
---
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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Need crash course in Dropbox library

2019-02-14 Thread Matthias Rebbe via use-livecode


@Mike @Greg

Please do it here. I am pretty sure there are others like me  who could benefit 
from it.

Regards,

Matthias


Matthias Rebbe

free tools for Livecoders:
https://instamaker.dermattes.de 
https://winsignhelper.dermattes.de 
> Am 14.02.2019 um 22:48 schrieb Mike Kerner via use-livecode 
> mailto:use-livecode@lists.runrev.com>>:
> 
> sup pink?
> Are you using the LC dropbox library or the phx library?
> We can do this here or off-list.
> 
> 
> On Thu, Feb 14, 2019 at 9:12 AM pink via use-livecode <
> use-livecode@lists.runrev.com > wrote:
> 
>> Sorry for asking like this, but I need a quick tutorial in using the
>> dropbox
>> library. I have an app that is running on an older Mac with Dropbox, and
>> Dropbox is discontinuing support for the OS. (Really it's a long story, but
>> the bottom line is that the video processing software runs faster on the
>> old
>> Mac than it does on newer machines, no idea why)
>> 
>> The task at hand... I need to upload video files to a folder setup for a
>> specified client on Dropbox. The folder may not already exist. The dropbox
>> account will always be the same. On average, the files will be 800MB each,
>> so I can't use the standard upload, I need to use the upload session, but I
>> am really unsure as to how it works.
>> 
>> Can someone point me towards what i need, or give me an example of how to
>> use the upload session commands to upload a large file?
>> 
>> THanks!
>> 
>> 
>> 
>> -
>> ---
>> 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@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."
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com 
> 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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Need crash course in Dropbox library

2019-02-14 Thread Mike Kerner via use-livecode
sup pink?
Are you using the LC dropbox library or the phx library?
We can do this here or off-list.


On Thu, Feb 14, 2019 at 9:12 AM pink via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Sorry for asking like this, but I need a quick tutorial in using the
> dropbox
> library. I have an app that is running on an older Mac with Dropbox, and
> Dropbox is discontinuing support for the OS. (Really it's a long story, but
> the bottom line is that the video processing software runs faster on the
> old
> Mac than it does on newer machines, no idea why)
>
> The task at hand... I need to upload video files to a folder setup for a
> specified client on Dropbox. The folder may not already exist. The dropbox
> account will always be the same. On average, the files will be 800MB each,
> so I can't use the standard upload, I need to use the upload session, but I
> am really unsure as to how it works.
>
> Can someone point me towards what i need, or give me an example of how to
> use the upload session commands to upload a large file?
>
> THanks!
>
>
>
> -
> ---
> 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@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."
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode