Hello, Mike Frysinger & Robert Ginda:
Zmodem File Transmission via Javascript is Practicable. Javascript Html Xterm 实现Zmodem 文件传输。
I had just implemented Zmodem Protocol via Javascript.
With the help of Javascript, Html5 FileReader, Websocket and JSCH,I implemented the basic zmodem protocol,
including :
request handshake, 请求握手
finish handshake, 关闭握手
file info sending, 文件信息传输
data sending, 文件内容传输
data receiving, 文件内容接收
crc checksum, CRC checksum 校验
network flowcontrol,流量控制
ascii escape, 二进制控制码转换
multil file support,多文件批量传输
...
and so on.
Main problem to solve:
1. z-modem protocol data packet.
2. convert websocket asynchronous io to ssh server's synchronized io.
It just work well. It is able to upload hundreds of file at a time and just allow files whos size is less then 4 GBytes, that is a limit of Zmodem protocol.
ScreenShot in text as below:
-----------------------------------------------------------------------------------------------------------------------------------------------
[yangyang.yyy@fly /home/yangyang.yyy/test/rzfiledir]
$rz Starting to receive file: Press Ctrl + C to Terminate the transfer. 4 files, 5.57MB in Total.
文件传输开始:按 Ctrl + C 终止传输。4个文件,共5.57MB。 SentBytes/Total Speed Estime/Time Prog f/a APro
ExtJsNEw.rar [#####################################################################] 1.62MB(1701518)/1.62MB 1.58MB/S 00:00/00:01 100% 1/4 29%
TreeGridEditor_v1.4.0-rc1.rar [####################################################] 1.50MB(1574714)/1.50MB 1.60MB/S 00:00/00:00 100% 2/4 56%
Windows _updata.rar [##############################################################] 1.28MB(1345317)/1.28MB 1.52MB/S 00:00/00:00 100% 3/4 79%
nginx-1.5.2.zip [##################################################################] 1.17MB(1224127)/1.17MB 1.44MB/S 00:00/00:00 100% 4/4 100%
上传成功!,已上传:4。总大小:5.57MB,速度:1.48MB,耗时:00:03。感谢您的使用。
-----------------------------------------------------------------------------------------------------------------------------------------------
ScreenShot in gif as below:
