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 / Web access on mobile doesn't work

Author
Message
niansenx
8
Years of Service
User Offline
Joined: 29th Jan 2016
Location:
Posted: 17th Apr 2017 19:20
Hello

I've spent some time working on getting my program to upload and download files from the web. It's working very well. However, I have now tested it on my phone and it doesn't seem to work at all. Weird thing is that all the error trapping I've put in to make sure the internet is available and the file exists does not trigger. The app on the phone says the upload/download succeeded, but nothing actually happens, the upload files do not appear on my website where I expect them to.

Any ideas what I'm doing wrong?
Thanks.
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 18th Apr 2017 14:40
Need to see some code.
niansenx
8
Years of Service
User Offline
Joined: 29th Jan 2016
Location:
Posted: 18th Apr 2017 17:56
Sure, here is my routine for pulling or pushing web data. It works fine when I'm running the code on my laptop, but on my phone, nothing.

function web_data(action as string, ifile as string)
//if internet is on...
if GetInternetState() =1
response$="fail"
//set up web
http = CreateHTTPConnection()
SetHTTPHost( http, "www.xxxxxxx.co.uk", 0)
//send or get file from web
if action="save"
SendHTTPFile(http , "uploadfile.php" , "" , "data\" + ifile)
elseif action="load"
//always read file to temp, as we may not want to overwrite our local data
GetHTTPFile( http, "mobile_data\"+ifile, "data\temp.txt" )
endif
//take 5 seconds to see if file updated
t=timer()
repeat
Sync()
until GetHTTPResponseReady( http ) = 1 or timer()>t+5
//if complete set success
if GetHTTPResponseReady( http )=1
response$="success"
endif
CloseHTTPConnection(http)
DeleteHTTPConnection(http)
else
response$="nointernet"
endif

endfunction response$
niansenx
8
Years of Service
User Offline
Joined: 29th Jan 2016
Location:
Posted: 18th Apr 2017 18:13
Found the answer!

My back-slashes needed to be forward-slashes when refering to the web location. My laptop didn't mind, but my mobile did!

Thanks.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 19th Apr 2017 08:56
Quote: "My back-slashes needed to be forward-slashes when refering to the web location. My laptop didn't mind, but my mobile did!"

Windows doesn't care, but mobiles (which are based on unix/linux) do care.
Signature removed by mod because it's larger than 600x120... please resize and try again.

Login to post a reply

Server time is: 2024-04-27 03:23:50
Your offset time is: 2024-04-27 03:23:50