Can't accept a list of files through FastAPI even though I am using the example code from the FastAPI website
23:18 18 Apr 2026

from fastapi import FastAPI, File, UploadFile, HTTPException

from pathlib import Path

from typing import List

@app.post("/uploadfile/")

def create_upload_file(file: List[UploadFile] = File(...)):

I am currently trying to get a list of files using fastapi, but no matter what I do I don't get an option to browse and upload a file , and can only enter a string of random characters. enter image description here

The code works perfectly when I change it to

def create_upload_file(file: UploadFile]):

Can someone please tell me what I am doing wrong?

python fastapi