trzsz.js released v0.4.0 new version supports dragging and uploading directories in the browser to the server

https://github.com/trzsz/trzsz.js  releases new version v0.4.0:

1. Support Windows local cmd, PowerShell, etc.

2. Support directory trz -d upload and tsz -d xxx download.

3. Support dragging files, even dragging directories, and uploading directly to the server.

Use the following code in the browser to upload files and directories by dragging and dropping.

terminalHtmlElement.addEventListener("dragover", (event) => event.preventDefault());
terminalHtmlElement.addEventListener("drop", (event) => {
  event.preventDefault();
  trzszFilter
    .uploadFiles(event.dataTransfer.items)
    .then(() => console.log("upload success"))
    .catch((err) => console.log(err));
});

You need to install trzsz or trzsz-go on the server and put the program in a certain path.     trz  PATH 


Guess you like

Origin www.oschina.net/news/202474