Forum GameFS 403 Forbidden when loading JSON file

Discussion and help relating to the PlayerIO game asset hosting and CDN solution, GameFS.

403 Forbidden when loading JSON file

Postby flyingvivaldi » December 2nd, 2014, 12:42 pm

I have a very simple SWF which does 2 things - logs in using a developer token and then attempts to load a small JSON file from the same (top) folder. I am using the getURL() method of the GameFS class. My problem is that all I get returned is a 403 Forbidden with the following XML as the response:

<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>D3AB25DC2C7609B2</RequestId><HostId>6kY1VVQm0EBW50c/49t46M9ok7a6e5do/7TPN0k3O/zNYPnY3nzxS42RZvWvWGDNtZmA7nSj27s=</HostId></Error>

Any ideas?
-Steve Mann
flyingvivaldi
 
Posts: 1
Joined: December 1st, 2014, 6:55 pm

Re: 403 Forbidden when loading JSON file

Postby nlarson » March 9th, 2018, 12:54 am

Beat my head against this with trying to pull down an xml file. Changed it to .Txt and added headers -
client.Headers.Add("Accept: text/html, application/xhtml+xml, */*");
client.Headers.Add("User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)");

and then it worked

if (PlayerIOGame != null)
{
var url = PlayerIOGame.GameFS.GetUrl("/Maps/MapPlaces.txt");
using (var client = new WebClient())
{
client.Headers.Add("Accept: text/html, application/xhtml+xml, */*");
client.Headers.Add("User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)");
client.DownloadFile(url, "c:\\temp\\MapPlaces.xml");
}
}
nlarson
 
Posts: 5
Joined: March 8th, 2018, 12:21 pm


Return to GameFS