Uploading substacks to DropBox

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
trevix
Posts: 1079
Joined: Sat Feb 24, 2007 11:25 pm
Contact:

Uploading substacks to DropBox

Post by trevix » Fri Sep 30, 2016 12:10 pm

I have a script that, thanks to the wonderful library "phxDropboxLib 1.12", uploads stacks to Dropbox.
Something like this:

Code: Select all

put URL ("binfile:" & pPathFrom) into pPathFrom
    put base64Encode(pPathFrom) into pPathFrom
    return phx_DropboxWriteFile("sandbox", pPathTo, "application/octet-stream", false, pPathFrom)
It works fine.

Now I would like to be able also to upload substacks.
Is there a way to get a correct pPathFrom of a substack, without making it a main stack?
Do SubStacks have a path?
The effective filename return the path to the main stack, so it is no useful.

Thanks
Trevix
Trevix
OSX 14.6.1 xCode 15 LC 10 RC1 iOS 15> Android 7>

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

Re: Uploading substacks to DropBox

Post by Klaus » Fri Sep 30, 2016 12:43 pm

Hi Trevix,
trevix wrote:Is there a way to get a correct pPathFrom of a substack, without making it a main stack?
No.
trevix wrote:Do SubStacks have a path?
No.

You coud try this workaround:
1. make your substack a mainstack
2. Save that to a (temporary) file and finally
3. Upload that file to Dropbox
4. Make that mainstack a substack again.


Best

Klaus

AndyP
Posts: 634
Joined: Wed Aug 27, 2008 12:57 pm
Contact:

Re: Uploading substacks to DropBox

Post by AndyP » Fri Sep 30, 2016 4:25 pm

Instead of using sub-stacks,you could just have multiple stacks and then initialize them for use by

start using stack "myStack" in the openStack handler of the main stack.

That way each pseudo sub-stack can have its own path.
Andy .... LC CLASSIC ROCKS!

trevix
Posts: 1079
Joined: Sat Feb 24, 2007 11:25 pm
Contact:

Re: Uploading substacks to DropBox

Post by trevix » Fri Sep 30, 2016 4:33 pm

Thanks to both.
I am going the "set the mainstack of ..." way, that look simpler.

I was a little concerned because LC in the past was messing things up when moving stack from main to sub and viceversa (I remember a Substack having still a path of its own...)
But in LC8 it seems to work, now.
Trevix
Trevix
OSX 14.6.1 xCode 15 LC 10 RC1 iOS 15> Android 7>

Post Reply