Densaugeo / uploadserver

Python's http.server extended to include a file upload page

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to upload?

weathon opened this issue · comments

It only shows files but don't allow me upload

The index page is served by the underlying http.server, and behaves the same way.

To upload, go to /upload (for example if the server is running at http://localhost:8000/ go to http://localhost:8000/upload ).

Oh, OK! Thanks!

Clarified instructions in readme 177d6d9

Thanks for reporting the issue.

I was confused by this also. Maybe a link to the upload page could be inserted into the directory listing HTML? This would mean overriding list_directory()

That would be handy.

I prefer not to replace and take on maintenance for any more of the built-in functions than I have to, but after a closer look it may be possible to create a .list_directory() that:

  • Calls the original .list_directory()
  • Inserts some new HTML into the file object returned by the original .list_directory() before passing it back
  • Iterates over ._headers_buffer and updates the content-length header.

Would also have the benefit of applying dark theme settings to the directory pages.