Giter Club home page Giter Club logo

http-file-handler-server's Introduction

Http-file-handler-server

File Handling using the extra options feature of HTTP Protocol(MIME)

The reason for this project is when you want to share files from your phone to pc/laptop or vice versa. What You do???

  • By Using the cable??
  • By some sharing apps??
  • By gmail?? For one to one these methods works well. But for one to many what you gonna do?????

Here it is..................

This was the reason for my project. In this project I created a HTTP Server for file handling, means you can upload file and delete them from anywhere only if your are connected to same network i.e., same Wifi/mobile network.

Split Up of Code...

First part is Configuring the System to required setup.

ENC = sys.stdout.encoding
ENC_MAP = {"cp936": "gbk"}
CHARSET = ENC_MAP.get(ENC, "utf-8")

reload(sys)
sys.setdefaultencoding("utf-8")

logging.basicConfig(
    level=logging.INFO,
    format="[%(asctime)s] [%(levelname)s] - %(message)s",
    datefmt="%Y-%m-%d %H:%M:%S",
)

FILE_NAME = os.path.basename(__file__).split('.')[0]
WORK_PATH = sys.argv[2] if sys.argv[2:] else os.getcwd()

Next part is HTML code to create a interface on the web which makes upload and delete files easier.

Next File Handling, means accessing the files from your local system. Here you can edit which directory You want (Default: Current Directory).

Http Request Handling, here the protocol communication ocuurs requesting and processing the response.

The main function----

  Here I am creating a socket for connection and then using multithreading concepts.
  whenever a new connection is made it creates one thread and run it. 
  So you can make simultaneous connections.

Usage

  > python http_server.py [port]
  or
  > python http_server.py 
        this takes a default port 8000
  -- For pc/laptop open web browser and type localhost:[port](default:8000)
  -- For mobile open browser and type the  systems ip adress:port number [example: 198.19.12.34:8000]
  • All the details will be stored in a json file. It is automatically created by code itself.

Screenshots

PC ScreenShot

Screenshot

Mobile Screenshot

Screenshot1

http-file-handler-server's People

Contributors

achyut2000 avatar

Watchers

James Cloos avatar  avatar

http-file-handler-server's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.