title: Size of PDF breaks FastAPI using python-multipart?
body: <p>I am trying to upload a <strong>PDF to FastAPI</strong>. After turning the PDF into a base64-blob and storing it in a txt-file, I POST this file to FastAPI using Postman.</p>
  
  <p>This is my server-side code:</p>
  
  <pre><code>from fastapi import FastAPI, File, UploadFile
  import base64
  
  app = FastAPI()
  
  @app.post("/uploadfile/")
  async def create_upload_file(file: UploadFile = File(...)):
      contents = await file.read()
      blob = base64.b64decode(contents)
      pdf = open('result.pdf','wb')
      pdf.write(blob)
      pdf.close()
      return {"filename": file.filename}
  </code></pre>
  
  <p>This procedure works fine for a single-page PDF document of size 279KB (blob-size: 372KB), but it doesn't for a multi-page document of size 1.8MB (blob-size: 2.4MB).</p>
  
  <p>When I try, I get the following WARNING and a 400 bad request response (along with the reseponse "detail": "There was an error parsing the body"):
  "Did not find boundary character 55 at index 2"</p>
  
  <p>I'm sure there must be an explanation for this behavior? Maybe it has something to do with async?</p>