Skip to content

Upload endpoint should reject requests without a file #3519

@danyili2632

Description

@danyili2632

Parent bounty: #743

Bug

POST /api/uploads returns HTTP 201 with { status: no-file, filename: null } when the request does not include the expected file multipart field.

A missing upload is invalid client input, but the current response looks like a successful resource creation. API clients can treat an empty upload as accepted and continue workflows without any stored file.

Expected

  • Requests without req.file should return HTTP 400.
  • The response should use the existing API error envelope: { success: false, message: ... }.
  • Valid file uploads should continue returning HTTP 201 with the uploaded filename.

Scope

Keep the fix limited to upload controller behavior and focused route tests.

This issue is limited only to the creator of this issue. This means that only the issue author can attempt to solve this issue. If you would like to work on it, please create another issue with the same contents and refer to issue #743 for more information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions