Support uploading binary files by printf+base64 like download.sh
Hi,
I have a feature request. I am thinking if iterm can have a "upload.sh" script that can do the reverse thing of "download.sh". For example, I can copy a text file to remote directory by cat > file.txt, and then paste the plain text to screen and then CTRL+D. But this only works for texts and not for binaries.
To upload a binary file, for example, we can do it using the new upload.sh by upload.sh > file.jpg in remote term session. Then, we will drag the local JPG file to the iTerm screen, and iTerm will encode the JPG binary to base64 plain text and send the text plus Ctrl+D to screen. Finally, upload.sh will decode base64 text content back to binary, and save to remote "file.jpg".
In this way, uploading a file can be done without rsync/scp, just like the magic "download.sh" and "imgcat" that printf file contents to screen.
Thanks!
btw, can we rename download.sh/upload.sh to something more special like iterm-get/iterm-put? "download.sh" is very general name, which might not be suitable to add to global $PATH.