Standalone through Remote Desktop access and VMs
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Standalone through Remote Desktop access and VMs
Thank you very much, Elanor. This was very helpful and it works fine. With your code I am now able to launch webpages from a HTML5 standalone.
Now, what I really need is something similar to be able to do what you described in your Lesson: Import/read the text of a webpage of type "https://www. ... .txt" into a LiveCode variable in a way which works also on a HTML5 standalone.
Is there such a short and elegant script for that too?
... or where in the HTML5 documentation can I find some more of the info I need to try to make it myself?
Thank you
-albert
Please consider that one reason for me to start seriously consider the HTML5 version of LiveCode is that I like the idea not to have to learn java.
Now, what I really need is something similar to be able to do what you described in your Lesson: Import/read the text of a webpage of type "https://www. ... .txt" into a LiveCode variable in a way which works also on a HTML5 standalone.
Is there such a short and elegant script for that too?
... or where in the HTML5 documentation can I find some more of the info I need to try to make it myself?
Thank you
-albert
Please consider that one reason for me to start seriously consider the HTML5 version of LiveCode is that I like the idea not to have to learn java.
Re: Standalone through Remote Desktop access and VMs
Hi Albert
If the file you want to load is on the same server as the HTML5 standalone you should be able to use put url, get url and load url.
There is an example here.
https://elanorb.on-rev.com/techsupport/ ... tTest.html
"put url" button code
"get url" button code
"load url" button code
If you want to access files that are not on your server you will probably run into cross origin issues(CORS).
If you have an example of a particular resource you think should be accessible that is not working please let us know.
I hope that helps.
Kind regards
Elanor
If the file you want to load is on the same server as the HTML5 standalone you should be able to use put url, get url and load url.
There is an example here.
https://elanorb.on-rev.com/techsupport/ ... tTest.html
"put url" button code
Code: Select all
on mouseUp
local tData
put url "https://elanorb.on-rev.com/techsupport/putexample/testfile.txt" into tData
put tData into field "content"
end mouseUp
Code: Select all
on mouseUp
local tData
get url "https://elanorb.on-rev.com/techsupport/putexample/testfile.txt"
put it into field "content"
end mouseUp
Code: Select all
on mouseUp
load url "https://elanorb.on-rev.com/techsupport/putexample/testfile.txt" with message "callBackHandler"
end mouseUp
on callBackHandler pURL, pStatus
if pStatus is "cached" then
put URL pURL into field "content"
else if pStatus is "error" then
put libURLErrorData(pURL) into field "content"
end if
end callBackHandler
If you have an example of a particular resource you think should be accessible that is not working please let us know.
I hope that helps.
Kind regards
Elanor
Elanor Buchanan
Software Developer
LiveCode
Software Developer
LiveCode
Re: Standalone through Remote Desktop access and VMs
Thank you very much again, Elanor. You are very helpful - and sorry not to have got your point earlier
For the test I am working on, not to be able to access files on the Internet from a HTML5 Standalone is a constraint which can be easily bypassed (just by changing the location of some files on the server). Will definitely test, and the solution/code you have shared should solve all my problems.
What I am worried about are my all my main applications, because my PC and Widows Standalones make extensive use of:
> accessing Internet files to fetch data (not just from files on my server)
> using ftp to store files in another server of mine located in a totally different domain
I realize that all this will NOT be possible with the HTML5 Standalone, or only under the very limiting conditions you described. Not happy, but good to know.
I also realize (hope I do not interpret incorrectly) that given this constraint it also becomes very critical WHERE to position the HTML5 Standalones. To reduce risks I was planning to rather place HTML5 standalones on test servers (where they would not interfere with other running processes), but then my HTML5 Standalones would be are pretty "disconnected" (unable to interact with all the files I have on my other servers).
Thank you again
-albert
For the test I am working on, not to be able to access files on the Internet from a HTML5 Standalone is a constraint which can be easily bypassed (just by changing the location of some files on the server). Will definitely test, and the solution/code you have shared should solve all my problems.
What I am worried about are my all my main applications, because my PC and Widows Standalones make extensive use of:
> accessing Internet files to fetch data (not just from files on my server)
> using ftp to store files in another server of mine located in a totally different domain
I realize that all this will NOT be possible with the HTML5 Standalone, or only under the very limiting conditions you described. Not happy, but good to know.
I also realize (hope I do not interpret incorrectly) that given this constraint it also becomes very critical WHERE to position the HTML5 Standalones. To reduce risks I was planning to rather place HTML5 standalones on test servers (where they would not interfere with other running processes), but then my HTML5 Standalones would be are pretty "disconnected" (unable to interact with all the files I have on my other servers).
Thank you again
-albert
Re: Standalone through Remote Desktop access and VMs
Hi Albert,
I am glad that was some help. If you have control of the servers you should be able to enable cross origin requests from specific other domains like your test server to ftp domain.
For files on other servers it may be that they are available to you, REST APIs etc are usually set up to allow access.
You might get some good advice on the HTML5 specific board from other users who have been working with HTML5 apps.
Kind regards
Elanor
I am glad that was some help. If you have control of the servers you should be able to enable cross origin requests from specific other domains like your test server to ftp domain.
For files on other servers it may be that they are available to you, REST APIs etc are usually set up to allow access.
You might get some good advice on the HTML5 specific board from other users who have been working with HTML5 apps.
Kind regards
Elanor
Elanor Buchanan
Software Developer
LiveCode
Software Developer
LiveCode
Re: Standalone through Remote Desktop access and VMs
Sorry to have to come back, Elanor, but I did some testing and still need help:
1. I implemented a stack in which there are 2 Buttons using your "load" method to access 2 txt files. It can be called from:
https://www.alpha-simulations.com/AAAIN ... /Test.html
2. The first button tries to open a txt file which is located in the same directory of my server where I placed the HTML5 standalone:
http://www.alpha-simulations.com/AAAINS ... Report.txt
1. I implemented a stack in which there are 2 Buttons using your "load" method to access 2 txt files. It can be called from:
https://www.alpha-simulations.com/AAAIN ... /Test.html
2. The first button tries to open a txt file which is located in the same directory of my server where I placed the HTML5 standalone:
http://www.alpha-simulations.com/AAAINS ... Report.txt
Re: Standalone through Remote Desktop access and VMs
3. The second button tries to call a txt file which is in a different directory (but on the same server):
https://www.alpha-simulations.com/DelSN ... Report.txt
RESULTS: The stack executes well, both buttons work and copy the text into the field.
BUT the HTML Standalone returns "Request failed 0".
What I am doing wrong? Am I understanding wrongly your statement "on the same server as the HTML5 standalone"?
https://www.alpha-simulations.com/DelSN ... Report.txt
RESULTS: The stack executes well, both buttons work and copy the text into the field.
BUT the HTML Standalone returns "Request failed 0".
What I am doing wrong? Am I understanding wrongly your statement "on the same server as the HTML5 standalone"?
Re: Standalone through Remote Desktop access and VMs
... and correct URL of the second text file I am trying to access is:
https://www.alpha-simulations.com/DelSN ... Report.txt
https://www.alpha-simulations.com/DelSN ... Report.txt
Re: Standalone through Remote Desktop access and VMs
Hi Albert,
Can you post the code of your buttons? Have you tried put, or get, instead of load?
Thanks
Elanor
Can you post the code of your buttons? Have you tried put, or get, instead of load?
Thanks
Elanor
Elanor Buchanan
Software Developer
LiveCode
Software Developer
LiveCode
Re: Standalone through Remote Desktop access and VMs
Yes. Here I copy/pasted the script of the first button:
on mouseUp
--load url "https://elanorb.on-rev.com/techsupport/ ... stfile.txt" with message "callBackHandler"
load url "https://www.alpha-simulations.com/AAAIN ... Report.txt" with message "callBackHandler"
end mouseUp
on callBackHandler pURL, pStatus
if pStatus is "cached" then
put URL pURL into field "repField"
else if pStatus is "error" then
put libURLErrorData(pURL) into field "repField"
end if
end callBackHandler
The second button is the same, besides the change in URL to "https://www.alpha-simulations.com/DelSN ... Report.txt"
I confirm that they work properly and return the text from the files, except for the HTML5 standalone version.
Btw, if you check it again you will see that I have added 2 buttons with the "launch" method you provided, and they both work well in the HTML5 standalone too.
on mouseUp
--load url "https://elanorb.on-rev.com/techsupport/ ... stfile.txt" with message "callBackHandler"
load url "https://www.alpha-simulations.com/AAAIN ... Report.txt" with message "callBackHandler"
end mouseUp
on callBackHandler pURL, pStatus
if pStatus is "cached" then
put URL pURL into field "repField"
else if pStatus is "error" then
put libURLErrorData(pURL) into field "repField"
end if
end callBackHandler
The second button is the same, besides the change in URL to "https://www.alpha-simulations.com/DelSN ... Report.txt"
I confirm that they work properly and return the text from the files, except for the HTML5 standalone version.
Btw, if you check it again you will see that I have added 2 buttons with the "launch" method you provided, and they both work well in the HTML5 standalone too.
Re: Standalone through Remote Desktop access and VMs
In the last version I inserted also a Get and a Put button.
Again, they work correctly, except in the HTML5 Standalone where they both return empty (in both cases the target field becomes empty).
Again, they work correctly, except in the HTML5 Standalone where they both return empty (in both cases the target field becomes empty).
Re: Standalone through Remote Desktop access and VMs
Hi Albert,
Your code looks ok. I did a test, with a copy of your file, on my server and it worked ok. I will attach my test stack which you can change to your file URL.
https://elanorb.on-rev.com/techsupport/ ... tTest.html
The test stack includes some answer dialogs to check the result which might give a clue to the issue. There is also a bug report related to certain characters causing issues when displayed in an HTML5 app. I wonder if this might be related.
https://quality.livecode.com/show_bug.cgi?id=23170
In the "Get Test 2" button I display the contents in an answer dialog before trying to display in the field, if it displays in the answer dialog but not the field that might mean the bug is affecting you.
Kind regards
Elanor
Your code looks ok. I did a test, with a copy of your file, on my server and it worked ok. I will attach my test stack which you can change to your file URL.
https://elanorb.on-rev.com/techsupport/ ... tTest.html
The test stack includes some answer dialogs to check the result which might give a clue to the issue. There is also a bug report related to certain characters causing issues when displayed in an HTML5 app. I wonder if this might be related.
https://quality.livecode.com/show_bug.cgi?id=23170
In the "Get Test 2" button I display the contents in an answer dialog before trying to display in the field, if it displays in the answer dialog but not the field that might mean the bug is affecting you.
Kind regards
Elanor
- Attachments
-
- AlbertTest.livecode.zip
- (2.16 KiB) Downloaded 138 times
Elanor Buchanan
Software Developer
LiveCode
Software Developer
LiveCode
Re: Standalone through Remote Desktop access and VMs
Thank you a lot again, Elanor, particularly for your patience. With your last post and download I was able to realize that:
1. All the scripts you were sending are working correctly now also on my server.
2. The problem was/is with the .txt files I was trying to import text from. They contain something that does not disturb LC in general, but disturbs/blocks the HTML5 standalones.
3. There was also a problem with the field in MY stack, which probably occurred after importing text with strange characters.
I still have to find out what the problem is with my txt files which causes HTML5 to crash (these files are actually created by a different LC App) but now it is clear that the problem is not on the HTML standalone side or the scripts to access txt files on the web. I will definitely report what I learned about my "bad" files once I have found it out.
Thank you again. In spite of its limitations I start liking the HTML5 standalone feature. But what really makes the difference is the great quality of the support one gets in this forum.
-albert
1. All the scripts you were sending are working correctly now also on my server.
2. The problem was/is with the .txt files I was trying to import text from. They contain something that does not disturb LC in general, but disturbs/blocks the HTML5 standalones.
3. There was also a problem with the field in MY stack, which probably occurred after importing text with strange characters.
I still have to find out what the problem is with my txt files which causes HTML5 to crash (these files are actually created by a different LC App) but now it is clear that the problem is not on the HTML standalone side or the scripts to access txt files on the web. I will definitely report what I learned about my "bad" files once I have found it out.
Thank you again. In spite of its limitations I start liking the HTML5 standalone feature. But what really makes the difference is the great quality of the support one gets in this forum.
-albert
Re: Standalone through Remote Desktop access and VMs
Hi Albert,
I'm glad to hear that got you a bit further forward. If you could possibly send the original text file to support@livecode.com I'll do some testing and report a bug.
Kind regards
Elanor
I'm glad to hear that got you a bit further forward. If you could possibly send the original text file to support@livecode.com I'll do some testing and report a bug.
Kind regards
Elanor
Elanor Buchanan
Software Developer
LiveCode
Software Developer
LiveCode
Re: Standalone through Remote Desktop access and VMs
Still looking for the problem. I have now 2 txt files in the same location (both can be easily accessed/read on the Web):
1. https://www.alpha-simulations.com/DelSN ... Report.txt
2. https://www.alpha-simulations.com/DelSN ... nAndUp.txt
Another test I have done is to download the first file (via FileZilla) and (without any changes) upload it again, but to a different directory (DelPDF rather than DelSNAPS)on the server. In this case the HTML5 standalone works. Probably the downloading itself changes some of the file characteristics, or removes the "problem" (which unfortunately I have not really identified as there are no differences in content between the these files).You can access the file at:
1. https://www.alpha-simulations.com/DelPD ... Report.txt
Will keep you informed. My challenge now is to change the original LC app which creates these report files (perhaps differently) so that they become readable also by the HTML5 standalone, which seems to see a difference between files which from my perspective are identical.
-albert
1. https://www.alpha-simulations.com/DelSN ... Report.txt
2. https://www.alpha-simulations.com/DelSN ... nAndUp.txt
- The first file blocks the HTML5 standalone (when using LOAD, GET or PUT).
The second works fine with the HTML 5 standalone too (using LOAD, but PUT and GET work too).
- The first file is an example of the typical report files generate by my LC app (using open file for write, then writing in it some text (around 40/50K), then closing it, and finally transferring it to the server location via ftp).
The second file is simply the result of downloading the first file (with Filezilla), just changing its Name (adding "DownAndUp"), and then uploading it again in the same location (with FileZilla).
Another test I have done is to download the first file (via FileZilla) and (without any changes) upload it again, but to a different directory (DelPDF rather than DelSNAPS)on the server. In this case the HTML5 standalone works. Probably the downloading itself changes some of the file characteristics, or removes the "problem" (which unfortunately I have not really identified as there are no differences in content between the these files).You can access the file at:
1. https://www.alpha-simulations.com/DelPD ... Report.txt
Will keep you informed. My challenge now is to change the original LC app which creates these report files (perhaps differently) so that they become readable also by the HTML5 standalone, which seems to see a difference between files which from my perspective are identical.
-albert
Re: Standalone through Remote Desktop access and VMs
My currect hypothesis is that the problem might be rooted on how I send the file to the server:
put "ftp://" & FTPUSER & ":" & FTPPASS & "@" & "ftp.cluster002....//{details removed}/DelSNAPS/" & ftpzipCreated into tDestination
libURLftpUploadFile zipCreatedFull, tDestination, "uploadComplete"
These lines work perfectly well since years. But now I notice that using "ftp" rather than "ftps" might be what causes the difference between the 2 apparently identical files.
Now, if I add an "s" to ftp in the line above, it does not execute well/transfer the file.
What I could try is to move from FTP to FTPS (or directly to SFTP?), modify the address above and see if this resolves the issue. I hope I succeed, and that users with previous versions (with the 2 lines above calling ftp) will not have problems.
put "ftp://" & FTPUSER & ":" & FTPPASS & "@" & "ftp.cluster002....//{details removed}/DelSNAPS/" & ftpzipCreated into tDestination
libURLftpUploadFile zipCreatedFull, tDestination, "uploadComplete"
These lines work perfectly well since years. But now I notice that using "ftp" rather than "ftps" might be what causes the difference between the 2 apparently identical files.
Now, if I add an "s" to ftp in the line above, it does not execute well/transfer the file.
What I could try is to move from FTP to FTPS (or directly to SFTP?), modify the address above and see if this resolves the issue. I hope I succeed, and that users with previous versions (with the 2 lines above calling ftp) will not have problems.