Generating variations on a code analysis question in a Brightspace quiz.Using a serial byte sent from an Arduino to launch an application on the PC.Using ffmpeg to take a snapshot with a webcam in Windows.Once the file has been downloaded once, the Netcat command will terminate and the file will no longer be available. Here’s how it looked when I received my example file (the teapot image, tea.png) in Firefox. As soon as you press return, the file will be downloaded. To receive the file on the Windows computer, simply open a browser and enter the IP address and port number of the source computer into the address bar. My computer’s IP address (on the local network) is 192.168.1.3 and the example command shown above specifies port number 8080. To receive the file on the destination computer, the IP address of the source computer is required. Once a connection is initiated from the receiving computer, the file (with HTTP header attached) will be streamed over the network. The pipe directs the file (with HTTP header attached) into Netcat (the “ nc” command), which listens for an incoming network connection on port 8080. The first part of the command, which is enclosed in curly braces prepends a HTTP header to the file contents and streams the whole lot into a pipe. In the above example, the file transferred is tea.png.
I’ve modified the command provided on the Wikipedia page slightly so that it works on the Netcat version available by default on Ubuntu 11.04. It sets up a “one-shot” transfer of a single file via Netcat on the source computer and a normal web browser on the destination computer.
TRANSFER FILES NETCAT WINDOWS HOW TO
Today, while I was trying to remember how to use it to transfer a file from a Linux computer to a Windows computer, I discovered the following gem of an example on Netcat’s Wikipedia page (accessed 22-10-2011). I’ve used it occasionally over the last few years for simple network operations like file transfer or getting two applications to talk to each other over the network. Netcat is an extremely useful and versatile command line utility for computer networking.