LiveUploadDef
class LiveUploadDef[Result]Immutable definition of a named upload.
Keep one stable definition value and reuse it with upload context operations. Runtime matching uses the destination's identity rather than structural equality, so recreating an otherwise identical definition may not match an upload that is already allowed.
name must be non-empty; numeric limits must be positive; and chunkTimeout must be positive
and at most Int.MaxValue milliseconds. Eager factory methods throw on invalid values, while
validated returns the validation error. Protocol encoding truncates fractional
milliseconds, so a positive timeout below one millisecond is sent as zero.
Type parameters
Resultthe result produced by each completed entry
Parameters
namestable upload name used by the form input and runtime; it is validated but not trimmed
acceptbrowser selection and preflight policy, not a content-security check
maxEntriespositive maximum number of entries accepted as valid during preflight, defaulting to 1; excess selections may remain visible as invalid entries
maxFileSizepositive per-entry limit in bytes, defaulting to 8,000,000; initially checked against client-reported metadata
chunkSizepositive requested browser chunk size in bytes, defaulting to 64,000
chunkTimeoutpositive browser chunk timeout, defaulting to 10 seconds and encoded with
chunkTimeout.toMillis.toIntautoUploadwhether valid entries start uploading without a form submit, defaulting to
falseprogressoptional callback for accepted browser progress reports, defaulting to none
maxEntriesModewhether only selected entries or all entries seen during this allowed lifecycle count toward
maxEntries, defaulting to Selectedvalidatoroptional validation of untrusted browser metadata; returning a reason rejects the entry
Exported from scalive.upload.LiveUploadDef. View source (scalive/api/src/scalive/upload/LiveUpload.scala:773-798)
Values10
accept
val accept: LiveUploadAcceptBrowser selection and preflight policy, not a content-security check.
Exported from scalive.upload.LiveUploadDef.accept. View source (scalive/api/src/scalive/upload/LiveUpload.scala:775-775)
autoUpload
val autoUpload: BooleanWhether valid entries start uploading without a form submit, defaulting to false.
Exported from scalive.upload.LiveUploadDef.autoUpload. View source (scalive/api/src/scalive/upload/LiveUpload.scala:780-780)
chunkSize
val chunkSize: IntPositive requested browser chunk size in bytes, defaulting to 64,000.
Exported from scalive.upload.LiveUploadDef.chunkSize. View source (scalive/api/src/scalive/upload/LiveUpload.scala:778-778)
chunkTimeout
val chunkTimeout: zio.package.DurationPositive browser chunk timeout, defaulting to 10 seconds and encoded with
chunkTimeout.toMillis.toInt.
Exported from scalive.upload.LiveUploadDef.chunkTimeout. View source (scalive/api/src/scalive/upload/LiveUpload.scala:779-779)
maxEntries
val maxEntries: IntPositive maximum number of entries accepted as valid during preflight, defaulting to 1; excess selections may remain visible as invalid entries.
Exported from scalive.upload.LiveUploadDef.maxEntries. View source (scalive/api/src/scalive/upload/LiveUpload.scala:776-776)
maxEntriesMode
val maxEntriesMode: LiveUploadMaxEntriesModeWhether only selected entries or all entries seen during this allowed lifecycle count toward
maxEntries, defaulting to Selected.
Exported from scalive.upload.LiveUploadDef.maxEntriesMode. View source (scalive/api/src/scalive/upload/LiveUpload.scala:782-782)
maxFileSize
val maxFileSize: LongPositive per-entry limit in bytes, defaulting to 8,000,000; initially checked against client-reported metadata.
Exported from scalive.upload.LiveUploadDef.maxFileSize. View source (scalive/api/src/scalive/upload/LiveUpload.scala:777-777)
name
val name: StringStable upload name used by the form input and runtime; it is validated but not trimmed.
Exported from scalive.upload.LiveUploadDef.name. View source (scalive/api/src/scalive/upload/LiveUpload.scala:774-774)
progress
val progress: Option[LiveUploadProgress[Result]]Optional callback for accepted browser progress reports, defaulting to none.
Exported from scalive.upload.LiveUploadDef.progress. View source (scalive/api/src/scalive/upload/LiveUpload.scala:781-781)
validator
val validator: Option[UploadClientMetadata => Option[String]]Optional validation of untrusted browser metadata; returning a reason rejects the entry.
Exported from scalive.upload.LiveUploadDef.validator. View source (scalive/api/src/scalive/upload/LiveUpload.scala:783-783)