This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# python -m SimpleHTTPPutServer 8080 | |
import SimpleHTTPServer | |
import BaseHTTPServer | |
class SputHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): | |
def do_PUT(self): | |
print self.headers | |
length = int(self.headers["Content-Length"]) | |
path = self.translate_path(self.path) | |
with open(path, "wb") as dst: |