0

I am writing some code for windows 8 that uses open data provided by the city of Vancouver. When I use the WinJS.xhr call on the data url:

ftp://webftp.vancouver.ca/opendata/csv/weekendplayfieldstatus.csv

I get the exception:

0x80070005 - JavaScript runtime error: Access is denied.

Here is the function call:

var url = ftp://webftp.vancouver.ca/opendata/csv/weekendplayfieldstatus.csv;
return WinJS.xhr({ url: url });

However, the very same call works for pretty much every other website I have tried. But, the rest have all been http and not ftp.

pppery
  • 3,731
  • 22
  • 33
  • 46
Bardia B
  • 33
  • 6

2 Answers2

0

IE's XMLHttpRequest object (which WinJS.xhr uses) doesn't support ftp protocol so that's why you get an error.

Try using BackgroundDownloader class which supports ftp downloads.

T W
  • 6,267
  • 2
  • 26
  • 33
0

The XHR acronym stands for "XML HTTP Request". The protocol it supports is in the name.

idbehold
  • 16,833
  • 5
  • 47
  • 74
  • Actually, it's not entirely true, http://stackoverflow.com/questions/6301280/can-ajax-use-protocols-other-than-http-or-https?lq=1, I was surprised too :) – T W Aug 13 '13 at 19:21
  • @TadeuszWójcik Not part of the spec though. So you can't really complain when it doesn't work using a different protocol. – idbehold Aug 13 '13 at 19:56