Skip to content

Add streaming upload support #18

@MarkReedZ

Description

@MarkReedZ

This should be fairly easy. Perhaps as the code below.

The parser returns -2 if more data is coming. We just have to call the handler after receiving the headers and continue to stream the data until done. When done also document how to setup nginx to stream data to the backend as it will cache the entire upload first otherwise.

We'll need to be able to set the max upload size.

@app.route('/',options=['stream'])
async def stream(r):
  num = 0
  while 1:
    data = await r.stream.read()
    if data == None:
      break
    num += 1
  return str(num)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions