Skip to content

Limit upload size of images #33

@joelvdavies

Description

@joelvdavies

Images should have a maximum upload size to avoid misuse, should be configurable like it is for attachments.

  • Reject image creation requests that pass a specific size
  • The maximum size should be configurable with the same default as the front end (currently 50MB at the time of writing)
  • We may also wish to consider adjusting the max_size used in the underlying SpooledTemporaryFile used via the UploadFile object if possible (see https://stackoverflow.com/questions/73442335/how-to-upload-a-large-file-%E2%89%A53gb-to-fastapi-backend) as depending on Generate and store image thumbnails #30 we may need the image to be fully in memory anyway and this should make the upload faster
  • Will need a larger and smaller image for e2e tests, one above the limit and one below (or we could potentially use faker/mock the data some other way?)
  • We need to ensure docker-ims is updated appropriately with the readme explaining these settings along with the one for the front end both of which should match the proxy config.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions