I dont understand why cant javascript make ftp calls?. Why do we have to make such a request using server?
Even Browsers have ability to authenticate and browse a ftp server. Maybe use browser api's to do it?
FTP (File Transfer Protocol) is an insecure protocol for transferring files from one host to another over the Internet.
This is an FTP client library for Node. js. It supports FTPS over TLS, Passive Mode over IPv6, has a Promise-based API, and offers methods to operate on whole directories.
Ok, answering my own question here.
I went through Mozilla docs on XMLHTTPRequest. It specifically says -
Despite its name, XMLHttpRequest can be used to retrieve any type of data, not just XML, and it supports protocols other than HTTP (including file and ftp).
So, I am satisfied with this. JavaScript can make calls to ftp using this.
The title of this question suggests the requester is keen on understanding if an FTP transfer could be implemented using JavaScript. However looking at the the answer by the same requester it appears that the question was just to know if URLs with FTP protocols can be used with JS and possibly HTML tags. The answer is yes. Even a simple <a>
tag supports FTP URLs in the href
attribute. Hope this helps the new readers. And yes, the XMLHttpRequest AJAX object does enable calling a URL with an FTP protocol.
Cheers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With