Fast file transfer with pseudo HTTP server

Time to time I need to transfer site from server to server very quickly and have not common solution for this, because I have permissios.

Solution is to use http server if you have this one of server with backups or use netcat.
On server side I run

nc -l -p 8080 < mybackup.tar.gz

or
netcat -l -p 8080 < mybackup.tar.gz

and now can use wget, curl or browser for this url:
http://serveradress:8080

if you sent link to client it will best to do little more:

(echo -e "HTTP/1.1 200\nContent-Disposition: attachment; filename=mybackup.tar.gz\n
Content-Type: application/octet-stream\nConnection: close\n"; cat mybackup.tar.gz ) 
| nc -vv -l -p 8080

Trackback URL for this post:

https://www.kalexandr.com/trackback/19
Links: