Cross Platform File Transfer using WiFi : Airshare (Opensource python based tool)

Are you still using a data cable to transfer files between your PC, phone, or laptop? Apple users have Airdrop and Android have multiple apps like Google Files, Xender, and Shareit and Windows have their own software to transfer files between similar platforms.

But what if you want to transfer files cross-platform like Windows to Mac or iOS or from Mac to Android and vice versa.

Cross-platform data transfers become a difficult job if you need to use different tools for different platforms. Carrying around data cables is laborious since we use different cables on apple devices and android devices.

Airshare

Airshare is a Python-based CLI tool and module that lets you transfer data between two machines in a local network, P2P, using Multicast-DNS. It also opens an HTTP gateway for other non-CLI external interfaces. It works completely offline! Built with aiohttp and zeroconf.
This is what the developers of Airshare define their software. For simplicity, Airshare is a python tool that can transfer files between systems in a local network that is the system should be connected to a common WIFi network.


You can read more about Airshare from their official documentation. In this post, I will share with you how to install and use Airshare.

Install Airshare on PC

You need to install Python on your PC to use Airshare so if you don't have python on your PC, download and install Python first.

If you have Python on your PC the next step is to install Airshare. To install Airshare, 
  • Open your terminal and run this command
 pip install Airshare  
If you have properly installed Python on your system this code above will install Airshare on your PC successfully.

Use Airshare to transfer files

Since Airshare is a CLI (command-line interface) tool there are multiple ways or commands to receive and send files. I will show you some easy ways you can use Airshare to send and receive files both between your PCs or PC and smartphone. For more methods to transfer files you can read Airsshare's official documentation.

When the receiver is PC

When the receiver is a PC irrespective of the operating system, you just need the receiving PC to have Airshare installed on it.

After successfully installing Airshare, Open your terminal and run this command.
 airshare -u receiver  
The -u flag opened an upload endpoint named receiver. This allows you to send files from multiple devices like your Mac, Windows, Linux, or even your smartphones with Android or iOS which does not have CLI support.

command prompt window after execution



You can either scan the QR code or just visit the endpoint URL on your browser where you can upload files to send to your PC.

When the receiver is a smartphone

When you need to send files from your PC to your phone which does not support CLI or python. You can not open an upload endpoint for your smartphone instead you have to specify the files on your PC in your CLI to send it to your smartphones or tablets.

If you want to send files from a directory open your terminal there and run this command.
 airshare -u sender file.txt  
Here a receiver end named sender is created.

Now your devices can receive file.txt by simply scanning the QR code or by opening the link.
If you want to send multiple files, you can do it by copying file or directory paths and using -fp flag.

Select required files and use the following shortcuts to copy file paths.
For Mac, Command + Option + C

For Windows, Shift + and select Copy as Path

For Linux, Ctrl + C
 airshare -fp sender filepath  
Substitute filepath with the copied file path.

send multiple files

Conclusion

The methods above provided will help you to transfer your files cross-platform. There are also some other features for Airshare which I have not specified here. You can refer to the official documentation of Airshare to know more.

Jobin Jose

No comments:

Post a Comment