langflow-ai/langflow · error · HTTPException

No file provided

Error message

No file provided

What it means

Error "No file provided" thrown in langflow-ai/langflow.

Source

Thrown at src/backend/base/langflow/api/v1/flows.py:657


@router.post("/upload/", response_model=list[FlowRead], status_code=201)
async def upload_file(
    *,
    session: DbSession,
    file: Annotated[UploadFile | None, File()] = None,
    current_user: CurrentActiveUser,
    folder_id: UUID | None = None,
    storage_service: Annotated[StorageService, Depends(get_storage_service)],
):
    """Upload flows from a JSON or ZIP file (upsert semantics for flows with stable IDs)."""
    # Authorization is enforced per-flow below, after parsing — the per-flow
    # check uses the actual workspace_id/folder_id each uploaded flow targets.
    # A coarse pre-parse check here would over-reject (it would authorize the
    # caller against ``domain="*", obj="flow:*"`` regardless of where the
    # uploaded flows actually land).
    if file is None:
        raise HTTPException(status_code=400, detail="No file provided")

    contents = await file.read()

    if not contents:
        raise HTTPException(status_code=400, detail="The uploaded file is empty")

    if zipfile.is_zipfile(io.BytesIO(contents)):
        try:
            flows_data = await extract_flows_from_zip(contents)
        except ValueError as e:
            raise HTTPException(status_code=400, detail=str(e)) from e
        if not flows_data:
            raise HTTPException(status_code=400, detail="No valid flow JSON files found in the ZIP")
        data = {"flows": flows_data}
    else:
        try:
            data = orjson.loads(contents)
        except orjson.JSONDecodeError as e:

View on GitHub (pinned to 976ec789d2)

Solutions

  1. Attach a file to the multipart request under the expected file field.

When it happens

Trigger: Occurs when a flow upload request is made without attaching any file in the multipart form data.

Common situations: See trigger scenarios.


AI-assisted analysis of langflow-ai/langflow@976ec789d2 (2026-08-14). Data as JSON: /api/errors/2f055ec192beef95. Report an issue: GitHub.