DEV Community

Transfer files from laptop to mobile using Python

Sahil Rajput on November 06, 2018

If you think that you need some fancy applications to tranfer files from your laptop/computer to mobile, than you are wrong. All you need is Python...
Collapse
 
phlash profile image
Phil Ashby • Edited

Almost as easy to go the other way too, pop in a POST handler for the BaseHTTPServer that accepts multipart/form-data, and craft an HTML page with a file input box.

fragments.turtlemeat.com/pythonweb... :)

Please do NOT expose to the Internet - there's a good reason NGiNX and Apache are popular and safe!

[edited to add] You can frequently find your laptop or other local devices are registered in your network with a name like: device.local or device.lan

Collapse
 
tamouse profile image
Tamara Temple

Oh, this is almost diabolical in it's greatness! I never really think about getting files from my mobile, since I'm mostly always using google drive.

Collapse
 
sndp487 profile image
Sandeep

github.com/sndp487/share-it

This is for mobile to laptop. Provides a simple web UI.

Collapse
 
tamouse profile image
Tamara Temple

This is useful. For those who don't do python, ruby has something similar, as does perl. Chances are you have at least one of these on your system!

Ruby: ruby -run -e httpd . runs a webserver in the current directory on port 3000.

Perl: http_this same thing (you'd probably need to install App-HTTPThis first though)

This is such a useful tool I made an alias for it!

Collapse
 
defman profile image
Sergey Kislyakov

I saw an app that generates the QR code to access the file over LAN. I don't remember the name, but I think it's not that hard to write your own. That would be much simpler to get the file rather than typing 192.168.whatever in your browser and then finding the file.

Collapse
 
sahilrajput profile image
Sahil Rajput • Edited

I think that would be great.

Thanks for the suggestion. I will soon post the complete program :)

Collapse
 
hackerton profile image
HackerTon

Used to called bitsync but now ResillioSync. Hope that helps.

Collapse
 
computersmiths profile image
ComputerSmiths

If you are already in the terminal,

ifconfig | grep ‘inet ‘

Will show your IP. I’ve got it aliased to ‘lan’ in my .profile

Collapse
 
ytjchan profile image
ytjchan

What about transferring from mobile to laptop? Any tricks 😉?

Collapse
 
sahilrajput profile image
Sahil Rajput

I will tell you if I found something .

Collapse
 
bduniyablog profile image
BlogDuniya.Live

apply these tips to transfer files from android to pc/laptop/computer
check out-bduniya.blogspot.com/2019/02/how-t...

Collapse
 
nromero125 profile image
Nelson Romero

Is a great idea, works very fine to me. Thanks!

Collapse
 
sahilrajput profile image
Sahil Rajput

Welcome

Collapse
 
diresi profile image
Christoph Rissner

What a great idea! Thanks!

Collapse
 
sahilrajput profile image
Sahil Rajput

Welcome :)

Collapse
 
abdurrahmaanj profile image
Abdur-Rahmaan Janhangeer

could've included a py script to show ip address here

Collapse
 
vukobrat profile image
Marko

Nice hack, thanks 4 share!

Collapse
 
sahilrajput profile image
Sahil Rajput

Welcome