Instantly run a simple no-installation web server on the command line, to allow easy file transfer between any Windows, Mac OS X and Linux machine, with the free sfk httpserv command.
Are you working on a machine without internet access, no shared
network folders, unavailable USB ports, missing admin rights,
and a thousand other reasons why it seems impossible
to transfer a single file? then try the following on a second
machine (the one from which you want to copy files).
sfk httpserv [-h[elp]] [-port=nport] [-rw]
The SFK Instant HTTP Server for easy file transfer.
* the CURRENT DIRECTORY is made accessible, without subdirs.
* any kind of directory traversal (.., / etc.) is blocked.
* just ONE CLIENT (browser etc.) can connect at a time.
only for trusted environments!
sfk httpserv is intended only for personal file transfer
between two machines that the user has control of, within
a trusted LAN environment. it should not be used to offer
files in the internet. if security is important then do not
use sfk httpserv but a full scale web server like Apache.
-port=n use other port than default, e.g. -port=81.
-port2=n alternative port, used if first port fails.
use -port2=0 to disable alternative port.
-rw allow write access. displays a single file
upload form when accessing "/".
-nolist do not provide a content listing, but change
any access to "/" into "index.html".
-deep allow reading of files in sub directories.
only for use with -nolist, as it does not
provide sub directory listings.
-raw send no http reply header, just raw content.
see alsosfk ftpserv -h the SFK Instant FTP server.
sfk wget a web file download command.
web referencehttp://stahlworks.com/sfk-httpservHow to copy any file between Windows and Linux machines:
If the target machine has ANY connection to a local network:
- on the source machine, where you have SFK already, type
sfk httpserv -port=9090
within the directory from which you want to transfer files.
- then, on the target machine, try to open a web browser
and to access
If that fails (no browser, no gui, no wget command),
check if there exists an "ftp" command on the target machine.
If so, try:
SFK Instant FTP Server for easy file exchange
- on another machine where you have SFK already, type
- then, on the target machine, type
and if the login succeeds, try
- if ftp connections fail to work, check if the "ftp"
client on the target accepts the command
then try to "get" again (ftp creates a new connection
per file download, which is often blocked by firewalls.
the passive command changes the way in which those
connections are created.)
How to get SFK up and running anywhere:
Download the executables for Windows, Linux/lib6 or Linux/lib5
then click on one of the top links to either download
binaries instantly, or look further on sourceforge:
On a Linux text console, use one of these:
- wget http://stahlworks.com/dev/sfk/sfk (Linux lib6)
- wget http://stahlworks.com/dev/sfk/sfk-lib5 (Linux lib5)
Whole distribution package in a .zip (insert version for nnn):
- wget http://stahlworks.com/dev/sfk/sfknnn.zip
Make sure your system has the real Info-ZIP unzip command,
in version 5.50 or higher (just type "unzip" to find out).
If nothing is available, get one of these:
- wget http://stahlworks.com/dev/unzip-linux-lib6.exe
- wget http://stahlworks.com/dev/unzip-linux-lib5.exe
Apple Macintosh and 64-bit Linux in general:
- there are no binary distributions so far, but you may compile
the source code easily, even if you're no software developer.
first, type "g++" to find out if a compiler exists on your system.
if so, download the source code, contained in the sfknnn.zip, from
then extract that by "unzip sfknnn.zip",
and take a look into do-compile-unix.bat or type:
g++ -DMAC_OS_X sfk.cpp patch.cpp inst.cpp -o sfk
Linux 64-bit compile:
g++ sfk.cpp patch.cpp inst.cpp -o sfk
How to prepare the SFK binary under Linux:
- after download, you have to type
chmod +x sfk-linux.exe
to enable execution (the 'x' flag) of sfk.
Then simply type
to get it running (the "./" is often needed as
the PATH may not contain the current directory ".").
Where to place the SFK executable:
Recommendation for Windows:
- create a directory structure
then rename sfknnn.exe to sfk.exe, and copy that to c:\app\bin .
If you use the "sfk alias" command later, the created alias
batch files will also be placed into "c:\app\bin".
- extend the Windows Shell Path
- make sure your Windows Shell supports command autocompletion
and Copy/Paste of text (the QuickEdit and Insert setting),
otherwise it is very hard to use! read more by typing
sfk help shell
- further tools can be installed parallel to "bin" into c:\app
This way you avoid the long, blank-character-contaminated,
inefficient default paths like "C:\Program Files".
Recommendation for Linux:
- type "cd" then "pwd" to find out what your account's
home directory is.
- within your home directory (e.g. /home/users/youruserid/)
create a directory "tools"
then rename sfk-linux.exe to sfk, and copy that
into the tools dir.
- extend the PATH like
- then you should be able to run sfk by typing "sfk".
By default, there are no colors, as it is not possible
to autodetect the background color under Linux.
If you like colorful output, type "sfk help color"
and read on how to set the "SFK_COLORS" variable
(read it careful! if you set a wrong "def:" value,
you may end up with white text on white background)