summaryrefslogtreecommitdiffhomepage
path: root/blog/entry/netcatsendfile.mdwn
blob: e9b8cceef84404198938e87a990acb626fef1ab8 (plain)
1
2
3
4
5
6
7
8
9
10
[[!meta date="2012-05-06 09:23:00"]]
[[!meta title="Use netcat to quickly transmit a large file over local LAN"]]
[[!tag  imported_PyBlosxom tech gnu+linux]]

Similar to the Python serve-a-single-directory trick, v. pleased to be
able to make use of this the other day:

    { echo -ne "HTTP/1.0 200 OK\r\nContent-Length: $(wc -c <some.file)\r\n\r\n"; cat some.file; } | nc -l -p 8080

([source](https://en.wikipedia.org/wiki/Netcat#Setting_up_a_one-shot_webserver_on_port_8080_to_present_the_content_of_a_file))