stream-chat-flutter icon indicating copy to clipboard operation
stream-chat-flutter copied to clipboard

Getting error while sending image on chat - File type application/octet-stream is not supported

Open ChiragGajjar opened this issue 2 years ago β€’ 29 comments

Which packages are you using?

stream_chat_flutter

On what platforms did you experience the issue?

iOS, Android

What version are you using?

stream_chat_flutter: ^6.10.0

What happened?

When we send image to chat it will getting upload error

Steps to reproduce

1. Chat message screen
2. select image and send
3. Getting error

Supporting info to reproduce

It will not getting error for all images, this happened only for some images

Relevant log output

flutter: 2023-09-13 14:53:11.923221 🚨 πŸ•ΈοΈ β•” DioExceptionType.badResponse
flutter: 2023-09-13 14:53:11.923911 🚨 πŸ•ΈοΈ β•‘    {
flutter: 2023-09-13 14:53:11.924592 🚨 πŸ•ΈοΈ β•‘         code: 4,
flutter: 2023-09-13 14:53:11.925728 🚨 πŸ•ΈοΈ β•‘         message: "UploadImage failed with error: "File type application/octet-stream is not supported"",
flutter: 2023-09-13 14:53:11.925857 🚨 πŸ•ΈοΈ β•‘         StatusCode: 400,
flutter: 2023-09-13 14:53:11.926025 🚨 πŸ•ΈοΈ β•‘         duration: "0.00ms",
flutter: 2023-09-13 14:53:11.926193 🚨 πŸ•ΈοΈ β•‘         more_info: "https://getstream.io/chat/docs/api_errors_response",
flutter: 2023-09-13 14:53:11.926666 🚨 πŸ•ΈοΈ β•‘         details: []
flutter: 2023-09-13 14:53:11.926803 🚨 πŸ•ΈοΈ β•‘    }

Flutter analyze output

No response

Flutter doctor output

[βœ“] Flutter (Channel stable, 3.10.5, on macOS 13.4.1 22F770820d darwin-arm64, locale en-IN)
    β€’ Flutter version 3.10.5 on channel stable at /Volumes/Personal/flutter
    β€’ Upstream repository https://github.com/flutter/flutter.git
    β€’ Framework revision 796c8ef792 (3 months ago), 2023-06-13 15:51:02 -0700
    β€’ Engine revision 45f6e00911
    β€’ Dart version 3.0.5
    β€’ DevTools version 2.23.1

[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    β€’ Android SDK at /Users/chiragsondagar/Library/Android/sdk
    β€’ Platform android-34, build-tools 34.0.0
    β€’ Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    β€’ Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
    βœ— Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

[βœ“] Xcode - develop for iOS and macOS (Xcode 14.3.1)
    β€’ Xcode at /Applications/Xcode.app/Contents/Developer
    β€’ Build 14E300c
    β€’ CocoaPods version 1.12.0

[βœ“] Chrome - develop for the web
    β€’ Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[βœ“] Android Studio (version 2022.1)
    β€’ Android Studio at /Applications/Android Studio.app/Contents
    β€’ Flutter plugin can be installed from:
      πŸ”¨ https://plugins.jetbrains.com/plugin/9212-flutter
    β€’ Dart plugin can be installed from:
      πŸ”¨ https://plugins.jetbrains.com/plugin/6351-dart
    β€’ Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)

[βœ“] Connected device (3 available)
    β€’ iPhone 14 Pro (mobile) β€’ 52EAB4E7-7218-4DBD-AAFD-976DA00D6BA8 β€’ ios            β€’ com.apple.CoreSimulator.SimRuntime.iOS-16-4 (simulator)
    β€’ macOS (desktop)        β€’ macos                                β€’ darwin-arm64   β€’ macOS 13.4.1 22F770820d darwin-arm64
    β€’ Chrome (web)           β€’ chrome                               β€’ web-javascript β€’ Google Chrome 116.0.5845.140

[βœ“] Network resources
    β€’ All expected network resources are available.

! Doctor found issues in 1 category.

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

ChiragGajjar avatar Sep 13 '23 09:09 ChiragGajjar

@ChiragGajjar can you also share the image which is throwing this error? I can test it on my end. Thanks

xsahil03x avatar Sep 13 '23 16:09 xsahil03x

driver

ChiragGajjar avatar Sep 13 '23 16:09 ChiragGajjar

And one another device we getting this issue, - Android

MicrosoftTeams-image

ChiragGajjar avatar Sep 13 '23 16:09 ChiragGajjar

Hey @ChiragGajjar, The file you uploaded is not a valid image file type. It's an ISO media that should be uploaded as a file rather than an image. Thanks.

Screenshot 2023-09-14 at 4 15 50 PM

You can also test it here: https://www.checkfiletype.com/

xsahil03x avatar Sep 14 '23 10:09 xsahil03x

And one another device we getting this issue, - Android

MicrosoftTeams-image

Can you verify if the necessary permissions are allowed for the app in settings?

xsahil03x avatar Sep 14 '23 10:09 xsahil03x

Yeah, We have given all permissions, it's working another device. but on that device we getting that issue.

ChiragGajjar avatar Sep 14 '23 10:09 ChiragGajjar

Hey @ChiragGajjar, The file you uploaded is not a valid image file type. It's an ISO media that should be uploaded as a file rather than an image. Thanks.

Screenshot 2023-09-14 at 4 15 50 PM You can also test it here: https://www.checkfiletype.com/

About this I have download some images from safari and 10% images is with this type - application/octet-stream.

ChiragGajjar avatar Sep 14 '23 11:09 ChiragGajjar

@ChiragGajjar I asked our backend team for info. I will keep you posted.

xsahil03x avatar Sep 18 '23 13:09 xsahil03x

Hi @ChiragGajjar,

Could you please share your app_id?

kanat avatar Oct 11 '23 08:10 kanat

I am closing this off as there is no progress or additional info.

Please don't hesitate to re-open it if the issue persists.

esarbanis avatar Oct 31 '23 11:10 esarbanis

People still report this issue on Android in the samples apps

esarbanis avatar Nov 20 '23 09:11 esarbanis

@esarbanis Any update on this issue? screenshot-1700737465421

ChiragGajjar avatar Nov 23 '23 11:11 ChiragGajjar

Here is the app ID:- 1198644

ChiragGajjar avatar Nov 23 '23 11:11 ChiragGajjar

@ChiragGajjar I am working on this now, I am trying to reproduce, I may have some more questions to help me out. Please bear with me πŸ™‚ πŸ™

esarbanis avatar Dec 07 '23 10:12 esarbanis

@ChiragGajjar I get the error that the mime type is image/avif have you tried adding this mime type to your app's configuration?

esarbanis avatar Dec 07 '23 10:12 esarbanis

I can't find out this methods on flutter.

client.updateAppSetting

ChiragGajjar avatar Dec 07 '23 12:12 ChiragGajjar

That can only be called from the server SDKs, alternatively you can go to the dashboard Chat Messaging -> Overview -> Upload Configuration -> Images and add an Allow behavior.

esarbanis avatar Dec 07 '23 12:12 esarbanis

I am gong to close this, but will have my eye out if this is reported again to re-open it.

esarbanis avatar Feb 19 '24 15:02 esarbanis

I see this issue was recently closed... why? I have been waiting for a resolution since October 2023. This is still an issue.

mednow-roman avatar Feb 22 '24 15:02 mednow-roman

I am happy to re-open it, but I would like your help to reproduce it @mednow-roman .

This was closed because no-one answered my question and lack of activity usually means either a fix or a workaround was found without communicating it.

esarbanis avatar Feb 22 '24 15:02 esarbanis

Great, thank you! Here are screenshots of my correspondence with your team regarding this. Let me know what else you need from me.

image image image image image image image image

mednow-roman avatar Feb 22 '24 16:02 mednow-roman

Files/Images are NOT blocked as far as I can tell. image

mednow-roman avatar Feb 22 '24 16:02 mednow-roman

@esarbanis Any updates on this? You asked for some details... were my screenshots enough?

mednow-roman avatar Feb 26 '24 16:02 mednow-roman

@mednow-roman Thank you for your help πŸ™ ! To be honest, I didn't find the time to go through them yet.

I expect to tackle this issue within the week. I am now driving this to master, but I going through conflict hell with it ...

esarbanis avatar Feb 26 '24 16:02 esarbanis

This issue is stale because it has been open for 20 days with no activity.

github-actions[bot] avatar Mar 17 '24 18:03 github-actions[bot]

Bump.

mednow-roman avatar Mar 19 '24 12:03 mednow-roman

@esarbanis Any update on this?

mednow-roman avatar Apr 01 '24 16:04 mednow-roman

This issue is stale because it has been open for 20 days with no activity.

github-actions[bot] avatar Apr 21 '24 18:04 github-actions[bot]

We pay $500 USD per month for your services so we would appreciate some progress updates and a timeline of when you expect to have this fixed by... and/or if it has been fixed already in a future version.

We are using the following stream packages:

stream_chat_flutter: 6.11.0
stream_chat_flutter_core: 6.10.0
stream_chat_localizations: 5.11.0

mednow-roman avatar Apr 22 '24 14:04 mednow-roman

@mednow-roman + @ChiragGajjar there's a lot of noise on this issue, I am creating a new thread with the issue so we can sort out the proper issue.

d3xvn avatar Jun 07 '24 13:06 d3xvn