简体   繁体   中英

JavaScript File Transfer SSH

I'm currently working on a browser based project where I'm using JavaScript, HTML and CSS for the first time, having had no past experience with these languages. Basically the project involves the following: (1) allowing the user to upload a .csv file via the following code:

    <input id="files" type="file" accept=".csv" />

(2) Reading the file, (3) converting to a YAML file (.yml) and (4) uploading it to a remote server via SSH/SCP/SFTP.

I've done (1) and (2) but what I'm having real trouble with is part 4. My questions are:

  • is it possible in JavaScript to upload a file to a remote server via SSH/SCP/SFTP, keeping in mind that this is a browser based project.
  • if no, what are some alternative browser based methods of allowing a user to do this?
  • any good resources on making .yml files using JavaScript?

Thank you.

Security in client-side JavaScript is a flawed idea and due to this it's unlikely that you will find JS-based SSH implementation (SSH is quite complex protocol family). The best options are either to have a Java applet to do the job (the applet must be properly digitally signed to be allowed to connect to third-party location) or upload the file to the web server and have it upload the file elsewhere.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM