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.
TxUploadAdapter txHttpUpload(TxHttpUploadConfig config)import 'dart:typed_data';
import 'package:tecexpress/tecexpress.dart';
Future<void> example() async {
// Requires your own multipart server with matching chunk assembly.
final upload = txHttpUpload(TxHttpUploadConfig(url: Uri.parse('https://example.com/api/upload')));
await upload(TxFile.fromData(Uint8List.fromList([72, 105]), name: 'hello.txt'), TxUploadContext(cancellation: TxCancellation(), onProgress: (loaded, total) => print('$loaded/$total')));
}