FileRestrictions
public struct FileRestrictions
A value type describing the constraints applied to file uploads.
This model is used to determine whether attachments can be uploaded, the maximum allowed file size (in MiB, where 1 MiB = 1024×1024 bytes), and the list of permitted MIME types.
Note
IfisAttachmentsEnabled is false, uploads should be disabled
regardless of size or type.
-
Maximum size of allowed uploads in megabytes (1024x1024).
Declaration
Swift
public let allowedFileSize: Int32 -
Details of allowed file mime types.
Declaration
Swift
public let allowedFileTypes: [AllowedFileType] -
True iff attachment uploads are allowed. If false, no uploads are allowed.
Declaration
Swift
public let isAttachmentsEnabled: Bool
-
Creates a new set of file upload restrictions.
Declaration
Swift
public init(allowedFileSize: Int32, allowedFileTypes: [AllowedFileType], isAttachmentsEnabled: Bool)Parameters
allowedFileSizeThe maximum allowed file size in mebibytes (MiB, 1024x1024 bytes).
allowedFileTypesThe list of permitted MIME types for uploads.
isAttachmentsEnabledA Boolean value indicating whether attachment uploads are allowed at all.
View on GitHub