You can check if you can read pieces of data one at a time.
If possible, then:
name = request.forms.get('name')
data = request.files.get('data')
raw = ""
if name and data.file:
while True:
datachunk = data.file.read(1024)
if not datachunk:
break
raw = raw + datachunk
filename = data.filename
return "Hello %s! You uploaded %s (%d bytes)." % (name, filename, len(raw))
If possible, you can also add a tracking mechanism for how large the file you want to read and if exceeded abort this operation.
, DDOS.