[Guide] Turn Android into a file server
- REVO
- Nov 25, 2015
- 2 min read
Python is one of the simple yet powerful languages which comes in handy at every level. The large number of utilities , libraries and packages provided makes it very versatile and flexible.
SimpleHTTPServer is one of the features of python that can be used to host a simple HTTP file server , avaiable for Windows and Linux platforms.
Transfering files from your droid device might sometimes be painful. You might have to plug-in the cables and switch some of the keys and then always careful while unplugging them too.
Is there a better way ?
So , here is a solution !
Requisites :
It is a python compiler available for Android devices. It is free and available at the playstore.
* The android device and the computer to which we are transferring the file should be connected to the same network.
An application that can monitor A-Z !
Procedure :
* Install both the applications mentioned above.
* Open OS Monitor and head to the Misc tab.

* Scroll down to the Network section and find out the IP address of your device and note it down. ( Search under the respective tab : If you are connected to WiFi, it should be under ' wlan0 ' and if you are tethering the internet from your device , then find it under 'ap0' )
* Open QPython and select editor.

Code :
SimpleHTTPServer
from os import chdir
chdir('/system')
SimpleHTTPServer.test()
> chdir is a library that allows you to change directory. So , set it to the path of the folder that you want to access on your computer . If you were access a sub-folder inside the SD card , you could put it as chdir('/sdcard/') .
If you have root access in your device , you might as well access system files too.
(eg : chdir('/') gives the files in the file system ).
* Now save this file in the desired location.
* Click on the run button.
* The console automatically fires up and runs a server at the default port 8000.

* Minimize the application and fire up a browser on your computer or any device to which you want to transfer the files.
* In the URL bar , type in the IP address that you noted down earlier followed by a ' : ' (colon without quotes) and then type in the port - 8000.
For example ,
your_ip:8000 (192.XXX.XX.XX : 8000 )
* You will be able to see the files listed on your browser. Right click on the file you would want to save and select ' Save link as '. Select the desired location and the file will be downloaded.

Since we have saved the server file , we can access it whenever we want by only having to change the directory inside chdir.
Advantages :
* No cables.
* Files are safe.
* Easy setup
Happy syncing !



![[Guide] Turn Android into a file server](https://static.wixstatic.com/media/7db52a_a5944999195647eea09b969cf1dd2902.png/v1/fill/w_447,h_250,fp_0.50_0.50,q_35,blur_30,enc_avif,quality_auto/7db52a_a5944999195647eea09b969cf1dd2902.webp)
![[Guide] Turn Android into a file server](https://static.wixstatic.com/media/7db52a_a5944999195647eea09b969cf1dd2902.png/v1/fill/w_220,h_123,fp_0.50_0.50,q_95,enc_avif,quality_auto/7db52a_a5944999195647eea09b969cf1dd2902.webp)
![[ MOD ] Simple WhatsApp MoD](https://static.wixstatic.com/media/7db52a_08bd28ff5e4b4990ab274e00be72a972.jpg/v1/fill/w_447,h_250,fp_0.50_0.50,q_30,blur_30,enc_avif,quality_auto/7db52a_08bd28ff5e4b4990ab274e00be72a972.webp)
![[ MOD ] Simple WhatsApp MoD](https://static.wixstatic.com/media/7db52a_08bd28ff5e4b4990ab274e00be72a972.jpg/v1/fill/w_220,h_123,fp_0.50_0.50,q_90,enc_avif,quality_auto/7db52a_08bd28ff5e4b4990ab274e00be72a972.webp)
![[ GUIDE ] How to bypass Android pattern lock security without system wipe](https://static.wixstatic.com/media/7db52a_d9b3087e53dd4b92971151443d569a79.png/v1/fill/w_447,h_250,fp_0.50_0.50,q_35,blur_30,enc_avif,quality_auto/7db52a_d9b3087e53dd4b92971151443d569a79.webp)
![[ GUIDE ] How to bypass Android pattern lock security without system wipe](https://static.wixstatic.com/media/7db52a_d9b3087e53dd4b92971151443d569a79.png/v1/fill/w_220,h_123,fp_0.50_0.50,q_95,enc_avif,quality_auto/7db52a_d9b3087e53dd4b92971151443d569a79.webp)
![[ Write-Up ] [ HackCon15 ] [ Forensics ] Surprise , MF](https://static.wixstatic.com/media/7db52a_ded9b2df5d0e42208cd8d495646e35d2.png/v1/fill/w_447,h_250,fp_0.50_0.50,q_35,blur_30,enc_avif,quality_auto/7db52a_ded9b2df5d0e42208cd8d495646e35d2.webp)
![[ Write-Up ] [ HackCon15 ] [ Forensics ] Surprise , MF](https://static.wixstatic.com/media/7db52a_ded9b2df5d0e42208cd8d495646e35d2.png/v1/fill/w_220,h_123,fp_0.50_0.50,q_95,enc_avif,quality_auto/7db52a_ded9b2df5d0e42208cd8d495646e35d2.webp)
![[ GUIDE ] Build Tweaks for Android](https://static.wixstatic.com/media/7db52a_d79242ffb23c4268a40bb1e894ed6338.png/v1/fill/w_447,h_250,fp_0.50_0.50,q_35,blur_30,enc_avif,quality_auto/7db52a_d79242ffb23c4268a40bb1e894ed6338.webp)
![[ GUIDE ] Build Tweaks for Android](https://static.wixstatic.com/media/7db52a_d79242ffb23c4268a40bb1e894ed6338.png/v1/fill/w_220,h_123,fp_0.50_0.50,q_95,enc_avif,quality_auto/7db52a_d79242ffb23c4268a40bb1e894ed6338.webp)
Comments