HTML5 can't load XML file on the same folder
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 32
- Joined: Sat Feb 27, 2021 12:17 am
HTML5 can't load XML file on the same folder
Hello,
I deployed an app that loads an XML file and displays its data. On windows standalone works great. But when I save standalone as HTML5, put url command does not work. Is there a way that I can read a file on my HTML5 standalone?
I deployed it on my webserver under www mydomain . com / myapp and also uploaded my xml file on the same folder.
I deployed an app that loads an XML file and displays its data. On windows standalone works great. But when I save standalone as HTML5, put url command does not work. Is there a way that I can read a file on my HTML5 standalone?
I deployed it on my webserver under www mydomain . com / myapp and also uploaded my xml file on the same folder.
-
- VIP Livecode Opensource Backer
- Posts: 7257
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: HTML5 can't load XML file on the same folder
Do you get an error in the result? I'm thinking the path may be wrong, what url do you use?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Posts: 32
- Joined: Sat Feb 27, 2021 12:17 am
Re: HTML5 can't load XML file on the same folder
Hello Jacque,
Yes I do get an error ""Failed to read preferences file at location" which means it can not find the file from the url i specified, inside the IDE when i try to load the file from : https://www.mydomain.som/file.xml it works normally but not when deploying to Html5.
Inside the stack I do have a button that saves a .txt file from a field to the "the effective filename of this stack" and load it back with another button that both work.
Any idea how to properly give the correct url of the xml file on my hosting server for the stack to be able to find and load it?
Thanks in advance.
Yes I do get an error ""Failed to read preferences file at location" which means it can not find the file from the url i specified, inside the IDE when i try to load the file from : https://www.mydomain.som/file.xml it works normally but not when deploying to Html5.
Inside the stack I do have a button that saves a .txt file from a field to the "the effective filename of this stack" and load it back with another button that both work.
Any idea how to properly give the correct url of the xml file on my hosting server for the stack to be able to find and load it?
Thanks in advance.
-
- Posts: 32
- Joined: Sat Feb 27, 2021 12:17 am
Re: HTML5 can't load XML file on the same folder
I now tried to find the path that the program runs from, but the effective filename of this tsack, returns "./this.program" which i have no idea what means
-
- VIP Livecode Opensource Backer
- Posts: 7257
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: HTML5 can't load XML file on the same folder
I'm just guessing, but the path you got for the effective filename of the stack indicates a relative path that points to the folder the stack is in. The "./" means the current folder. You might want to try simply "./file.xml" and see if that works.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Posts: 32
- Joined: Sat Feb 27, 2021 12:17 am
Re: HTML5 can't load XML file on the same folder
I already tried this with No luck.
Re: HTML5 can't load XML file on the same folder
If you have a lc server, you can use this to get the server path.
if you name the file serverpath.lc , launch serverpath.lc in the browser, you will see a result that gives the full server path to the serverpath.lc file
or try this for php
Code: Select all
<?lc
put $_Server["PATH_TRANSLATED"]
?>
or try this for php
Code: Select all
<?php
echo realpath('path.php');
?>
Andy Piddock
https://livecode1001.blogspot.com Built with LiveCode
https://github.com/AndyPiddock/TinyIDE Mini IDE alternative
https://github.com/AndyPiddock/Seth Editor color theming
http://livecodeshare.runrev.com/stack/897/ LiveCode-Multi-Search
https://livecode1001.blogspot.com Built with LiveCode
https://github.com/AndyPiddock/TinyIDE Mini IDE alternative
https://github.com/AndyPiddock/Seth Editor color theming
http://livecodeshare.runrev.com/stack/897/ LiveCode-Multi-Search