t×tecexpressby TeKOcloud
ENv0.7.1
API & Datentypen / VUE

TxHttpUploadConfig.

Multipart-HTTP-Konfiguration mit Zieladresse, Feldern, Headern und optionalen 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>
}
FeldBedeutung
urlZieladresse des Uploadservers.
fieldNameMultipart-Feldname der Datei.
headersZusätzliche HTTP-Header.
withCredentialsSendet Browser-Credentials bei XHR.
fieldsZusätzliche Multipart-Textfelder.
chunkSizeChunkgröße in Bytes; muss positiv sein.
chunkFieldsFelder je Chunk; Index ist nullbasiert.
ts
import type { TxHttpUploadConfig } from '@tekocloud.de/tecexpress'
const example: TxHttpUploadConfig = { url: '/api/upload', fieldName: 'file' }
console.log(example)