Saving external files with HTML5 standalone ?

Bringing your stacks to the web

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
raugert
Posts: 112
Joined: Thu May 26, 2016 9:30 pm
Location: Winnipeg, Canada

Saving external files with HTML5 standalone ?

Post by raugert » Sat Oct 07, 2017 10:58 pm

I currently use a LC application that updates files in a directory on my local MAMP server. These are then used by an HTML page that updates a scoreboard. So far this all works fine... but now when I save my app as an HTML5 standalone, I can no longer save my data files in the same directory as they were before. The HTML5 version doesn't recognize my local directory structure.

So where can I save external files now if I want to build HTML5 standalones ?

thanks for any advice,
Richard
Livecode Indy 9.6.11 (Stable)
MacOS Sonoma 14.2
Xcode 15.0.1 SDK 17.0

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Saving external files with HTML5 standalone ?

Post by [-hh] » Sun Oct 08, 2017 2:58 pm

You can't write from a HTML5 standalone or it's calling webpage **by client side functions only** to a server.
You need a server side part (php or lc-server or ...) that does this for you whenever you call it.
And you have to obey more and more stronger same-origin-policies for that.

On the other hand:
Of course you (or the user of your standalone) can write *actively* to your *local file system* (or he to his local file system) from the webpage using the HTML5 file system API.
You may do that from your standalone by do as "javascript" from the calling webpage of your standalone. See for example the info here how to do that from a webpage:
https://www.html5rocks.com/de/tutorials ... ilesystem/
shiftLock happens

raugert
Posts: 112
Joined: Thu May 26, 2016 9:30 pm
Location: Winnipeg, Canada

Re: Saving external files with HTML5 standalone ?

Post by raugert » Sun Oct 08, 2017 3:56 pm

@-hh

Thank you very much. That's exactly what I was afraid of... I had played a bit with LC-server and PHP in the past but found it more complicated. So I was cheating by writing "server side events" directly to files on my local MAMP server. Now that I want to use HTML5 deployment, I guess it's time to revisit the LC-server option... :)

The do as "javascript" option isn't ideal for me as the data must be shared.
Livecode Indy 9.6.11 (Stable)
MacOS Sonoma 14.2
Xcode 15.0.1 SDK 17.0

Post Reply

Return to “HTML5”