Creates a multipart POST adapter. The server must assemble chunks. Non-success HTTP responses and network errors fail the upload.
Parameter: config with a required URL; returns TxUploadAdapter. The adapter receives file and context and asynchronously returns the final HTTP response text. fieldName = file; extra fields/headers default to empty. chunkSize must be positive; chunkFields receives file, zero-based index and count. Cancellation and HTTP/network failures reject the operation. No automatic JSON parsing or server-side chunk assembly.
function txHttpUpload(config: TxHttpUploadConfig): TxUploadAdapterimport { txHttpUpload } from '@tekocloud.de/tecexpress'
const upload = txHttpUpload({ url: '/api/upload', fieldName: 'file', chunkSize: 1024 * 1024 })
// Browser only; requires your own multipart server and chunk assembly.
const controller = new AbortController()
await upload(new File(['Hello'], 'hello.txt'), { signal: controller.signal, onProgress: (loaded, total) => console.log(loaded, total) })