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 / Empty File Problem after downloading using GetHTTPFile

Author
Message
Rudders
12
Years of Service
User Offline
Joined: 20th Jan 2012
Location: Oxfordshire UK
Posted: 18th Apr 2013 12:30 Edited at: 18th Apr 2013 12:31
Hi all,

I am downloading a file from a web site using GetHTTPFile. The process appears to work ok and the file is transferred but the downloaded file is empty.. 0 bytes!

I am saving the file with the same name as the one downloaded.

Any ideas, anyone else had this issue? Here is my simple code:

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 18th Apr 2013 13:09 Edited at: 18th Apr 2013 13:10
i think because host name

SetHTTPHost(http_id,"www.mysite.co.uk",0)
If GetHTTPFile(http_id,"/test/stockmastertab.txt","stockmastertab.txt") = 1
or

If GetHTTPFile(http_id,"test/stockmastertab.txt","stockmastertab.txt") = 1
Rudders
12
Years of Service
User Offline
Joined: 20th Jan 2012
Location: Oxfordshire UK
Posted: 18th Apr 2013 15:31
You got it, Marcus.... Brilliant again thanks!

It was If GetHTTPFile(http_id,"/test/stockmastertab.txt","stockmastertab.txt") = 1

That sorted this.

Cheers again, Rudders
Rudders
12
Years of Service
User Offline
Joined: 20th Jan 2012
Location: Oxfordshire UK
Posted: 18th Apr 2013 15:40
A thought on the subject!

Surely if the file is NOT present the return should have been 0 and no local file created? I have also had a local file created containing a web page error message if the server file is not there,

Is this a fault or am I missing something?

Cheers

Rudders
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 18th Apr 2013 15:59
i thinks its already on the wishlist if the webserver return a 404 not found or <> ok.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 18th Apr 2013 16:52
Pretty much none of the HTTP commands give you any sort of indication of error.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 1st May 2013 22:11
I already had this exact same issue, but Paul said at the time that he would look at the documentation so hopefully that might help a little in the future.
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 2nd May 2013 04:42
you could use


Login to post a reply

Server time is: 2024-05-03 18:58:08
Your offset time is: 2024-05-03 18:58:08