A delightful (and exceptionally nerdy) way to move files between devices
iTunes was driving me absolutely bonkers.
I just wanted to move some ebooks from a PC to an Apple device, but the accounts didn’t match and iTunes had a bad attitude about that. Long story short, I discovered LOTS of ways to move the books without iTunes, but in the process of solving the problem, I discovered a tiny, free, portable, and really useful tool. Now that I know about it, I keep it on a USB drive on my keychain. I’ve used it dozens of times and it has saved the day more than once. If you’re technically minded and use Windows machines I’ll show you what I discovered. Here we go…
Meet the HFS HTTP File Server
HFS is a tiny Windows program that will let you directly transfer files from your PC to any smart phone, tablet, Mac, Chromebook or another PC without installing any software on the receiving device. It has the Ninja stealth of a portable app that can set up a file server running off a Thumb Drive in only a few seconds.
HFS is a free, open source, easy to use drag-and-drop file server for personal file sharing. It is essentially a portable web server application designed for sharing files instead of web pages. It requires no installation, little or no configuration, and can easily move large files from your PC to other computers, mobile devices, and even virtual machines. Any device with a web browser can connect to HFS, which will present a simple HTML page that lists the shared files and allows them to be downloaded. (HFS stands for HTTP File Server and has nothing to do with Apple’s similarly abbreviated Hierarchical File System.)
You can use HFS on your Wi-Fi or local network with almost no configuration. This is a great way to transfer that huge ebook or video file from your PC to your iPad without battling with iTunes. If you are willing to set up port forwarding on your router, HFS has advanced features for connecting to the public Internet allowing anyone in the world to download, or upload, files directly to your PC. HFS will automatically find your public IP address, allow you to set up user accounts, limit bandwidth used, and even work with dynamic DNS services so you can have a consistent URL to connect to HFS even when your ISP changes your home IP address.
Why not Dropbox or FTP?
There must be a hundred ways to transfer files, so why bother with HFS? As it turns out, HFS is often faster to setup and use than most alternatives. HFS has the advantage of facilitating a high-speed direct connection between your PC and the downloading computer or device. This eliminates the need to upload a file to a remote service and then download it again. FTP software such as FileZilla Server also allows a direct connection, but it is more complex to set up than HFS and quite a bit harder to get working with your firewall and router if you want to use it on the public Internet. Using the web makes sense since web browsers are available on most devices, and HFS makes sense because it is free, easy to use, allows a direct connection and offers a lot of flexibility in a small, portable, ninja-like package.
Try it Out!
Let’s take HFS for a spin. We will need a PC running any modern version of Windows. HFS is reported to work on every version from Windows 98 to Windows 10.
Start by downloading hfs.exe from this link. The entire program is just over 2 MB, which is impressive when you consider that many phones these days take single photos that are larger than that.
HFS does not have an installer, so we can keep the hfs.exe executable file anywhere on our system. We can run it right from the Desktop, we can run it from a USB Thumb Drive we keep on a keychain, or we can copy it to the C:\Program Files\
folder like traditional installed software. HFS does not require Administrator privileges to run, but we will need Administrator access if we want to copy the program to C:\Program Files\
.
Massimo Melina, the author of HFS, has not digitally signed the program, so you should expect to see a security warning from Windows that it is from an unknown publisher. Also, if you are using Windows Firewall, the first time you run HFS Windows may open a dialog box asking if it should allow hfs.exe to communicate on private and public networks. HFS is useless if it cannot connect to the network, so you should give it permission.
Next HFS will open an Option dialog box asking if you want an “Add to HFS” shortcut on your Windows context menu when you right-click on files. Since we are just trying out HFS, go ahead and select No. You can always add this later from the application if you find yourself using HFS a lot. (You do this in Expert mode by selecting: Menu → Other options → Integrate
in shell context menu).
For such a tiny program, HFS has a surprising number of features. To keep the program simple and focused on how the majority of people use it, HFS starts in “Easy mode”, which hides more advanced functionality. Let’s explore some of the common uses of HFS in Easy mode.
Pick a few files that you do not mind sharing and drag and drop them onto the Virtual File System pane in HFS. To keep things simple for now, do not drag and drop a folder, only individual files.
Click anywhere in the Virtual File System pane to make sure that your files are not selected and then click the “Open in browser” button, which will open your default web browser to http://localhost/. You should see your shared files in a simple web interface.
At the moment your PC is acting as both the server (HFS) and the client (web browser), which is not that useful, but it does demonstrate how HFS works. The web interface allows you to click on files to download them individually, or to select multiple files which can be downloaded in a tar-format archive (you can open tar files on Windows using 7-Zip). Notice that with the default settings you do not need a login to gain access and there is no ability to upload or delete files, only download them.
As long as the firewall software on your PC allows connections to HFS on port 80, any web browser on any device on your local network should be able to view the web interface and download files. Give this a try on another device on your network, such as a laptop, an iPad or your phone. Use the web browser on this device and go to the URL shown in the HFS URL bar.
Using HFS to Move an eBook to an iPad
In the example below we share a few epub format ebook files in HFS by dragging them into the Virtual File System pane. We open the address that HFS gives us (in this case http://10.0.0.7) on an iPad using the Safari web browser. The web interface looks very similar to how it looked in Chrome on the PC. We tap the shared Dracula ebook, and the iPad begins downloading the file.
The iPad asks us which app we want to use to open the book file. We tap Open in “iBooks”, which saves a copy of the book in iBooks.
We have successfully transferred the book from the PC to the iPad and can start reading it in iBooks
The HFS Log pane records the request made by the iPad and shows the transfer speed of the file.
Using Folders and Accounts and Enabling Uploads
We have access to additional functionality when we use folders. Create a new folder on the Desktop called WebUpload and drag it into the HFS Virtual File System pane. HFS may display a dialog box asking if you want ANYONE to be able to upload to this folder. If it does, be conservative and click No. It is far better to set up an account to allow upload access only to specific users. We will do that below.
When we drag a folder into HFS it asks if we want a Real folder or a Virtual folder. Selecting a real folder provides the most flexibility, allowing web users to upload files to the folder if we grant them access. Let’s try this now. Click Real folder when HFS asks what kind of folder we want.
Right click the WebUpload folder in HFS, select Properties and then select the Upload tab. From this tab we can both create users and grant them upload permissions. We will create a user called Anna and give her the ability to upload files into the WebUpload folder. To do this click New account and enter the Username Anna and a password, and click OK.
HFS will show the Anna user with a check-mark in the Upload tab.
Click OK to save your changes.
Click “Open in browser” to view the web interface. Note that there are no upload buttons in the interface because we have not yet logged in. Go ahead and click Login and enter Anna’s login information. In the Actions section of the web interface you should now see an Upload button that will place any uploaded files into the WebUpload folder.
We can add granular security by allowing only certain users to access specific folders. We do this exactly the same way we added Upload permissions except this time we check the names of users in the Access tab instead of the Upload tab. Selecting Anna in the Access tab and clicking OK will allow only Anna to see this folder. We can restrict access to the entire website to Anna by right clicking on the web root “/
”, selecting Properties, and checking Anna in the Access tab.
Going Global
Before we talk about setting up HFS for use on the public Internet we need to talk about security. We obviously need to be careful when allowing Internet traffic to directly access our PC. It is critical that we use Windows Update and ensure that our system has all the most recent security patches installed. We highly recommend setting up HFS with a sufficiently complex root level password. Also, be aware that just creating an account in HFS is not enough to protect your files, you must follow the directions in the previous section to right click on a folder or file and set the permissions to explicitly require a login to access the folder or file. Finally, we recommend testing your system from outside your network to make sure it works as you expect.
While we are talking about security, you should know that HFS can support HTTPS and SSL, but it requires setting up an additional tool called Stunnel. You can read about Stunnel here. If you are not using SSL, be aware that your file transfers are not encrypted.
To allow users outside of your home network to access HFS over the Internet you generally need to setup port forwarding on your router. Because some ISPs block port 80, it is usually a good idea to pick a higher port, such as 8000. To set this up on our Comcast router, we start by logging into the router’s web interface and selecting Advanced and Port Forwarding. You router will likely have a different interface, but the concept should be the same.
We enable port forwarding and add a service directing all traffic on port 8000 to the IP address shown in the HFS address bar.
The router shows port forwarding enabled.
In HFS, click on the “Port: 80” button and change the port to 8000. HFS contains a feature to test Internet access and tell you the IP address for browsers to use. To activate it, select Menu → Self Test
and follow the prompts. If we see the test successful message, we should be all set to use HFS to connect to our PC from anywhere on the Internet.
When we are done allowing Internet users to directly connect to our PC we should immediately turn off port forwarding on our router to improve the security on our network.
When we exit HFS it will ask if we want to save our current file system. Saving it will create a vfs file that will remember our shared directory structure. Note that other settings, including information about users is stored in the Windows registry by default. This can be saved to a file instead, or erased from the registry by putting HFS in Expert mode and selecting the appropriate command from Menu → Save options
.
Whoa. That was way longer than I thought it would be when I started writing. If you made it this far, thanks for sticking with me! I hope you find HFS as useful as I have.
Learned something? Click the 💚 to say “thanks!” and help others find this article.
You can also follow me here on medium and learn more about me on my website. If you didn’t enjoy this, I’d love to know why in the comments.