uploadString method
Uploads a file to the backend from a string.
If not provided, mimeType
defaults to application/octet-stream
.
Throws an ApiException if the upload fails.
Implementation
@override
Future<FileMetadata> uploadString({
required String fileName,
required String fileContents,
String? fileId,
String? bucketId,
String mimeType = applicationOctetStreamType,
UploadProgressCallback? onUploadProgress,
}) async {
return await _uploadMultipartFile(
file: http.MultipartFile.fromString(
'file',
fileContents,
filename: fileName,
contentType: MediaType.parse(mimeType),
),
fileId: fileId,
fileName: fileName,
bucketId: bucketId,
onUploadProgress: onUploadProgress,
);
}