this is my upload function
void upload() async {
print("inside upload image");
if (file == null) return;
String base64 = base64Encode(file.readAsBytesSync());
String imagename = file.path.split("/").last;
dynamic data = {"imagename": imagename, "image64": base64};
try {
response1 = Dio().post(
"***********************",
data: data,
options: Options(
followRedirects: false,
validateStatus: (status) {
return status < 500;
}),
);
} on DioError catch (e, s) {
print("what happend when upload image ? : " + e.toString());
}
}
when try to upload an image in the app the image showed successfully in the app < but when trying to send it to the api i get this error