1.final formData = FormData.fromMap({
'file': await MultipartFile.fromFile(
file.path,
filename: fileName,
contentType: MediaType.parse('video/mp4'),
),
});
2.final response = await dio.put<dynamic>(endpoint, data: formData, options: Options(contentType: 'video/mp4'));
return response.data;
above I changed the content type to video/mp4
(I tried both ways separately) but I am still getting multipart/form-data; boundary=--dio-boundary-3846454268
After changing content type is should also change to video/mp4
in S3 bucket console, it didn't change and because of that I am getting corrupted file in S3 bucket although I successfully uploaded a video. Looks like default content type in Multipart request is not changing although I tried both ways.
Any ideas how to change the default content type of Dio Multipart request in Flutter? Thanks