Reputation: 2231
I have a chrome extension, so it's pure javascript + chrome api. I want to upload via FTP protocol a file.
I have understood that vanilla javascript can't do FTP request. But is there any other way ? I'm in a Chrome extension but I haven't find any ftp purpoes in the online API
And I have to clarify, I have to upload a file via FTP on black box. I don't have any control on it. And this black box is not accessible via Internet, only via local network.
Upvotes: 1
Views: 4420
Reputation: 1937
It seems like you can use the chrome-app-ftp library
var ftpClient = new FtpClient(host, port, user, password);
ftpClient.connect().then(function () {
ftpClient.upload("test.txt", buffer)
});
But the socket api doesn't available in extensions. here is more information about it
Upvotes: 3