What is the syntax to do a cross-domain XMLHTTPREQUEST to an FTP server?

前端 未结 3 689
攒了一身酷
攒了一身酷 2020-12-03 11:02

I have an webDav CORS plugin, which I can use to POST/PUT/GET/REMOVE/ALLDOCS files on a webDav server.

I now want to do the same for FTP, but I\'m struggling to get

3条回答
  •  佛祖请我去吃肉
    2020-12-03 11:59

    Although the Mozilla MDN docs reference xmlHttpRequest supporting file and ftp none of the major browsers do AFAIK. It is one of the reasons why you need to serve your web projects from some sort of server, even if it is on the same machine, if you want to develop/test any xmlHttpRequest stuff since file:// doesn't work.

    Microsoft specifically states that IE only supports http/https. The W3C spec for it also says that the spec is only for HTTP/HTTPS but that 'some implementations support protocols in addition to HTTP and HTTPS, but that functionality is not covered by this specification'.

    As for CORS, it is specifically only for HTTP/HTTPS. The spec is all about using HTTP headers. See the W3C spec here. FTP doesn't have any equivalent type of header as HTTP.

提交回复
热议问题