Code Monkey home page Code Monkey logo

simplehttpserverwithupload's Introduction

SimpleHTTPServerWithUpload

Simple HTTP Server With Upload written in Python.
This script works with version 3.6.
Earlier versions will cause runtime errors.

This is a modified version from the original source.
https://gist.github.com/UniIsland/3346170

I have added icons for directory and videos.
Pictures (BMP, GIF, JPG, PNG) will display thumbnails.

Directory listing is in a table format with file sizes and creation dates.

This script also supports IP Address & Port binding.

Change 'SimpleHTTPServerWithUpload.sh' to suit your requirements.

Note
$\color[RGB]{255,0,128}\ I\ am\ not\ the\ original\ author.$
$\color[RGB]{255,0,128}If\ there\ are\ any\ issues\ please\ go\ to\ the\ above\ listed\ URL.\ Thank\ you.$

simplehttpserverwithupload's People

Contributors

peytonxuaspose avatar tallguy297 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

simplehttpserverwithupload's Issues

Invalid URL (ends with "/None")

Whenever I upload a file, the Back button doesn't really take me back. Instead, it takes me to 127.0.0.1/None. I'm guessing it's because my browser doesn't send referer headers?

Rather than depending on on referers, you could try sending users to a URL that ends in /., as that will send the user to the current url, acting as a kind of POST-free refresh.

Please change line 98 in SimpleHTTPServerWithUpload.py to the following:

        f.write(("<br><br><a href=\"%s\">" % '.').encode())

An ordinary browser should treat that dot as invalid, and discard it, and bring you back to the dir listing page. Assuming you were accessing this server from 127.0.0.1:8000, the Back button will take you to 127.0.0.1:8000 everytime.

Edit: Better yet, use this:

        f.write(("<br><br><a href=\".\">").encode())

Can't find out file name

Hello, I'm trying to upload this way:
time curl -F "file[]=@/home/user/chicken.jpg" localhost:8000/
and I get (False, "Can't find out file name..." error

Also there's 1 second of delay no matter how big (or small) is the file. Do you have any idea why ?
The delay happens at the first call to line = self.rfile.readline() after that all is blazing fast.

Attribute error

It doesn't work for me.

python3 SimpleHTTPServerWithUpload.py

Traceback (most recent call last):
  File "SimpleHTTPServerWithUpload.py", line 333, in <module>
    with socketserver.TCPServer((BIND, PORT), Handler) as httpd:
AttributeError: __exit__

Order by date

Hi! Would it be possible to list the files ordered by date?

Thanks :)

Trying to get in touch regarding a security issue

Hi there,

I couldn't find a SECURITY.md in your repository and am not sure how to best contact you privately to disclose a security issue.

Can you add a SECURITY.md file with an e-mail to your repository, so that our system can send you the vulnerability details? GitHub suggests that a security policy is the best way to make sure security issues are responsibly disclosed.

Once you've done that, you should receive an e-mail within the next hour with more info.

Thanks! (cc @huntr-helper)

Ansible role

Hi,
Do you have any experience with Ansible?
We may try to create together ansible role that will install SimpleHTTPServerWithUpload.py and add systemd service for it. So it will be possible to start/stop HTTPServer by service.

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.