sorry for the really late reply! Just cleaning up my mailbox, and that was
S. Sara [2019-10-21 15:52 +0000]:
I am working on a cockpit plugin. Among some features, I would like
to be able to upload some heavy binary files (# 500MB) to remote machines through cockpit
Do you have some advices on how to do this ?
has some details about
this. Indeed this needs documentation and some refinement (Stef recently made
the chunking better), but at least with spawning a process like dd, having that
write the output file, and feeding blocks into it with .input() seems like a
workable solution for now.
It of course would be better if the cockpit.file() API would support sending
the contents in multiple chunks, but cockpit.js doesn't currently do that.
However, the *protocol*  does allow it. I. e. you can open a raw channel 
with the payload="fsreplace1" type, and feed the data using channel.send() in
multiple blocks. I'm not aware of an existing example there, but that's IMHO
the most elegant and efficient way.