t×tecexpressby TeKOcloud
DEv0.7.1
API & types / VUE

TxHttpUploadConfig.

Multipart HTTP configuration with a destination, fields, headers and optional chunks.

ts
interface TxHttpUploadConfig {
  url: string
  fieldName?: string
  headers?: Record<string, string>
  withCredentials?: boolean
  fields?: Record<string, string>
  chunkSize?: number
  chunkFields?: (
    file: File,
    index: number,
    count: number,
  ) => Record<string, string>
}
FieldMeaning
urlUpload server destination.
fieldNameMultipart file field name.
headersAdditional HTTP headers.
withCredentialsSends browser credentials with XHR.
fieldsAdditional multipart text fields.
chunkSizeChunk size in bytes; must be positive.
chunkFieldsFields per chunk; index is zero-based.
ts
import type { TxHttpUploadConfig } from '@tekocloud.de/tecexpress'
const example: TxHttpUploadConfig = { url: '/api/upload', fieldName: 'file' }
console.log(example)