httpftpxmlhttprequestwinjs

access denied when using winjs.xhr for ftp


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.


Solution

  • 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.