flutter_uploader
flutter_uploader copied to clipboard
iOS return 500 while using flutter uploader with version 1.x
For android the flutter uploader works fine, the server able to upload the data. But for iOS, I meet this issue.
Then, I have tried the flutter uploader with version 3.0 beta, it didn't appear this error, but it straight went into this line first and the progress automatically = 100 uploader.result.listen((result) { BotToast.showText(text:"Complete"); } instead of this uploader.progress.listen((progress) { BotToast.showText(text:progress.progess.toString()); }
then it automatically run 2nd time ( uploader.enqueue() ) then start from listening the progress=0. When the progress =100 and result = UploadTaskStatus.complete , it did toast the complete but my server couldn't receive any data from it.
have you checked that the issue is not the content-type header? we had the same issue (server not receiving anything when the request came from iOS but worked fine on android) and setting no content-type header worked for MultipartFormDataUpload Related issue #204
@neohboonyee99 @brianegan @ened @raphaelgurtner what does setting no content-type header means? Can you please tell me what to write? Here is my code:
await FlutterUploader().enqueue(
RawUpload(
url: uploadUrls[i],
// required: url to upload to
path: selectedVideos[i].path,
// required: list of files that you want to upload
method: UploadMethod.PUT,
// HTTP method (POST or PUT or PATCH)
// headers: {"apikey": "api_123456", "userkey": "userkey_123456"},
//I have also tried uncommenting this headers property and also tried adding "content-type": ""
tag: 'post video uploading', // custom tag which is returned in result/progress
),
);
I have also tried uncommenting this headers property and also tried adding "content-type": "". but I still keep getting this:
2022-10-14 22:38:30.737288-0700 Runner[38503:2433526] URLSessionDidSendBodyData: chillisource.flutter_uploader.upload.background.D598E59F-A80E-4679-A0FD-C96072EBD3C0, byteSent: 27486, totalBytesSent: 1436312, totalBytesExpectedToSend: 1436312, progress:100.0
2022-10-14 22:38:35.192360-0700 Runner[38503:2433526] URLSessionDidReceiveData:
2022-10-14 22:38:35.195193-0700 Runner[38503:2433244] URLSessionDidCompleteWithError: chillisource.flutter_uploader.upload.background.D598E59F-A80E-4679-A0FD-C96072EBD3C0 with response: <NSHTTPURLResponse: 0x600000f43d20> { URL: https://storage.googleapis.com/upload/storage/v1/b/vip-picnic-app.appspot.com/o?name=storyVideos0.000000hBzdHCIpRoNZQtOtfPwxgeLcdjN20.00000097068b00-4c4b-11ed-bba8-7beae6c674d0.mp4&uploadType=resumable&upload_id=ADPycdt3HJwFYv0lbVuC0fD3BF9Mm8oPTY6SHjAwQJYJMxxfoofxpqMXAHMbFsWHFvBJtT-JPT7cWZcvp3SSZMpk08Ntgg } { Status Code: 200, Headers {
"Alt-Svc" = (
"h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\""
);
"Cache-Control" = (
"no-cache, no-store, max-age=0, must-revalidate"
);
"Content-Length" = (
1051
);
"Content-Type" = (
"application/json; charset=UTF-8"
);
Date = (
"Sat, 15 Oct 2022 05:38:35 GMT"
);
Etag =
2022-10-14 22:38:35.195748-0700 Runner[38503:2433244] URLSessionDidCompleteWithError: upload completed
2022-10-14 22:38:35.197371-0700 Runner[38503:2433244] URLSessionDidCompleteWithError: response: {
"kind": "storage#object",
"id": "vip-picnic-app.appspot.com/storyVideos/hBzdHCIpRoNZQtOtfPwxgeLcdjN2/97068b00-4c4b-11ed-bba8-7beae6c674d0.mp4/1665812314898425",
"selfLink": "https://www.googleapis.com/storage/v1/b/vip-picnic-app.appspot.com/o/storyVideos0.000000hBzdHCIpRoNZQtOtfPwxgeLcdjN20.00000097068b00-4c4b-11ed-bba8-7beae6c674d0.mp4",
"mediaLink": "https://storage.googleapis.com/download/storage/v1/b/vip-picnic-app.appspot.com/o/storyVideos0.000000hBzdHCIpRoNZQtOtfPwxgeLcdjN20.00000097068b00-4c4b-11ed-bba8-7beae6c674d0.mp4?generation=1665812314898425&alt=media",
"name": "storyVideos/hBzdHCIpRoNZQtOtfPwxgeLcdjN2/97068b00-4c4b-11ed-bba8-7beae6c674d0.mp4",
"bucket": "vip-picnic-app.appspot.com",
"generation": "1665812314898425",
"metageneration": "1",
"storageClass": "STANDARD",
"size": "1436312",
"md5Hash": "PbTA0xQyreLSsiI3AkB4qA==",
"crc32c": "FJx0tg==",
"etag": "CPn/qrrC4foCEAE=",
"timeCreated": "2022-10-15T05:38:35.003Z",
"update