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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Upload your files</title> | |
</head> | |
<body> | |
<form enctype="multipart/form-data" action="upload.php" method="POST"> | |
<p>Upload your file</p> | |
<input type="file" name="uploaded_file"></input><br /> | |
<input type="submit" value="Upload"></input> |
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
from cgi import parse_qs | |
from wsgiref.simple_server import make_server | |
def simple_app(environ, start_response): | |
status = '200 OK' | |
headers = [('Content-Type', 'text/plain')] | |
start_response(status, headers) | |
if environ['REQUEST_METHOD'] == 'POST': | |
request_body_size = int(environ.get('CONTENT_LENGTH', 0)) | |
request_body = environ['wsgi.input'].read(request_body_size) |
NewerOlder