DEV Community

Cover image for Fastest way to transfer file within Ubuntu to Ubuntu or Mac to android on same network
Sahil kashyap
Sahil kashyap

Posted on • Edited on

Fastest way to transfer file within Ubuntu to Ubuntu or Mac to android on same network

Install

http-server
npm install --global http-server

open CMD,type in this

http-server
it returns

Starting up http-server, serving ./ http-server version: 14.1.1 http-server settings: CORS: disabled Cache: 3600 seconds Connection Timeout: 120 seconds Directory Listings: visible AutoIndex: visible Serve GZIP Files: false Serve Brotli Files: false Default File Extension: none Available on: http://127.0.0.1:8080 http://192.168.0.116:8080 Hit CTRL-C to stop the server 
Enter fullscreen mode Exit fullscreen mode

in other laptop open chrome,type this
http://192.168.0.116:8080

And start downloading

In Mac

Open terminal,Navigate to Downloads folder

sh cd Downloads

Type in this command

http-server ./ -p 1313

./ specifily will serve only the content in Download folder

-p is the port

Starting up http-server, serving ./ http-server version: 14.1.1 http-server settings: CORS: disabled Cache: 3600 seconds Connection Timeout: 120 seconds Directory Listings: visible AutoIndex: visible Serve GZIP Files: false Serve Brotli Files: false Default File Extension: none Available on: http://127.0.0.1:1313 http://192.168.0.108:1313 Hit CTRL-C to stop the server 
Enter fullscreen mode Exit fullscreen mode

In Your android , open up chrome
Type in the url
http://192.168.0.108:1313

And select the file, it'll start downloading
in Android mobile

Top comments (0)