1

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.

6
  • stackoverflow.com/questions/17761373/… Commented Apr 29, 2015 at 12:56
  • 1
    JavaScript only understands HTTP and WebSockets, it does not have support for any other protocol. You need to be using a server-side language to achieve this, i.e PHP Commented Apr 29, 2015 at 12:57
  • stackoverflow.com/questions/166221/… Commented Apr 29, 2015 at 12:57
  • @JoshStevenson So why it get a response ? If it doesn't support ftp request it should alert KO or throw an exception, no ? Commented Apr 29, 2015 at 13:11
  • What response is it getting Emrys Commented Apr 29, 2015 at 13:13

1 Answer 1

3

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.