Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / HTML5 - GetHTTPFile seems to work but file isn't available (BUG?)

Author
Message
Zappo
Valued Member
20
Years of Service
User Offline
Joined: 27th Oct 2004
Location: In the post
Posted: 6th Jul 2019 23:14
Hi,
The GetHTTPFile command works fine on everything except the HTML5 export. It appears to download the file and even the progress counter works, but when it has finished downloading the file does not exist.
Here is a quick example of how to replicate the issue. When the file download is completed it should say either "File exists" or "Files does not exist".



Any advice anyone has would be very much appreciated.
Incidentally, does anyone know where the downloaded files may be stored? I am guessing they may just be kept in memory, or perhaps saved in the browser cache.

Chart data provided with kind permission from ELSPA
Increase
7
Years of Service
User Offline
Joined: 21st Feb 2017
Location:
Posted: 6th Jul 2019 23:43
It should be stored in GetWritePath() ;

it would be great if SetRawWritePath() gets updated, or if the RAW: command could be used in the GetHTTPFile command to be able to specify a directory everywhere on the harddisk.
Zappo
Valued Member
20
Years of Service
User Offline
Joined: 27th Oct 2004
Location: In the post
Posted: 7th Jul 2019 02:35
Thanks for replying Increase. My problem above seemed to be related to a caching problem so that particular test code works fine now. The GetWritePath() command has helped as it shows the HTML5 player sets this as "/" rather than a full file path. That is okay.

The problem I have in my current project (which has been difficult to pin down and reproduce) is if I download files into a subfolder. So for example the following code should make a folder inside "/media" called "new" and download the file into there. If I then set the current folder to be "/media/new" and list the files in there it shows up in Windows but not using the HTML5 player.



I am now wondering if the problem is with the GetFirstFile or GetNextFile commands. I hope I this above makes sense. It has confused me no end over the last few hours as the project works perfectly on Windows - just not when exported to HTML5.

Chart data provided with kind permission from ELSPA
Increase
7
Years of Service
User Offline
Joined: 21st Feb 2017
Location:
Posted: 7th Jul 2019 03:10
I guess those file commands don't work with HTML ; maybe it can be done with refferal to a *.php script, something like -> https://www.tutorialrepublic.com/php-tutorial/php-file-download.php



Zappo
Valued Member
20
Years of Service
User Offline
Joined: 27th Oct 2004
Location: In the post
Posted: 7th Jul 2019 11:37
I am using PHP to manage and push out the files but unfortunately I need AppGameKit to download and display the files, so that cannot be done server-side.

The HTML version of AppGameKit seems have no problem downloading files and using them but they just don't seem to appear if you put them in a subfolder and use the GetFirstFile command. Strange.

Chart data provided with kind permission from ELSPA
Zappo
Valued Member
20
Years of Service
User Offline
Joined: 27th Oct 2004
Location: In the post
Posted: 8th Jul 2019 10:33
After lots more testing I can now confirm that the issue is with the GetFirstFile/GetNextFile commands not actually listing files in the HTML5 player. It doesn't matter if I force the file to be downloaded into the default location or a subfolder. Accessing the file by its exact name (with or without the path) works fine so it is definitely there, but trying to list the contents of the folder always comes back empty.

I will have to think of a way around this purely for the HTML5 version.

Chart data provided with kind permission from ELSPA
RedBLuePill
5
Years of Service
User Offline
Joined: 3rd Apr 2019
Location:
Posted: 19th Jul 2019 01:21
I think some network commands don't work on HTML compiled.
Zappo
Valued Member
20
Years of Service
User Offline
Joined: 27th Oct 2004
Location: In the post
Posted: 19th Jul 2019 16:18
Hi RedBluePill.
The network commands I want do work in HTML5. It can download and access files fine if you access them by their names. The issue is definitely with the GetFirstFile/GetNextFile commands trying to list files. They seem to return empty.

Chart data provided with kind permission from ELSPA

Login to post a reply

Server time is: 2024-11-22 15:44:23
Your offset time is: 2024-11-22 15:44:23