Skip to content

Upload: Restrict file extensions and total size of Web uploads #4895

Description

@lastzero

As an Admin, I want to restrict the types of files that may be uploaded so that the web upload is safe to use.

The following additional config options have been added for this:

Environment CLI Flag Default Description
PHOTOPRISM_IMPORT_ALLOW --import-allow restrict imports to these file types (comma-separated list of EXTENSIONS; leave blank to allow all)
PHOTOPRISM_UPLOAD_ALLOW --upload-allow restrict uploads to these file types (comma-separated list of EXTENSIONS; leave blank to allow all)
PHOTOPRISM_UPLOAD_ARCHIVES --upload-archives allow upload of zip archives (will be extracted before import)
PHOTOPRISM_UPLOAD_LIMIT --upload-limit 1000 maximum total size of uploaded files in MB (1-100000; -1 to disable)

Note: Uploaded files that are rejected because their type is not included in PHOTOPRISM_UPLOAD_ALLOW are not added to the library and so may be lost, while PHOTOPRISM_IMPORT_ALLOW simply does not copy these file types to the originals folder without deleting them from the import folder.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

releasedAvailable in a stable releasesecurityImpact on server or browser securitysharingSharing with users, anonymously via links or publiclytestedChanges have been tested successfully

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions