Page 1 of 1

Uploading substacks to DropBox

Posted: Fri Sep 30, 2016 12:10 pm
by trevix
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

Re: Uploading substacks to DropBox

Posted: Fri Sep 30, 2016 12:43 pm
by Klaus
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

Re: Uploading substacks to DropBox

Posted: Fri Sep 30, 2016 4:25 pm
by AndyP
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.

Re: Uploading substacks to DropBox

Posted: Fri Sep 30, 2016 4:33 pm
by trevix
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