Skip to content

Instantly share code, notes, and snippets.

@teh
Created January 16, 2012 23:11
Show Gist options
  • Save teh/1623516 to your computer and use it in GitHub Desktop.
Save teh/1623516 to your computer and use it in GitHub Desktop.
uploader
import eventlet
from eventlet import wsgi
CHUNK_SIZE = 2**13 # 8k
def upload(env, start_response):
data = []
while True:
d = env['wsgi.input'].read(CHUNK_SIZE)
if len(d) < CHUNK_SIZE:
break
data.append(d)
start_response('200 OK', {})
print "MAGIC HAPPENS AFTER UPLOAD"
return ["HI"]
wsgi.server(eventlet.listen(('', 3000)), upload)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment