GetStream / stream-chat-flutter

Flutter Chat SDK - Build your own chat app experience using Dart, Flutter and the Stream Chat Messaging API.
https://getstream.io/chat/sdk/flutter/
Other
932 stars 344 forks source link

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

Closed ChiragGajjar closed 5 months ago

ChiragGajjar commented 1 year ago

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

xsahil03x commented 1 year ago

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

ChiragGajjar commented 1 year ago

driver

ChiragGajjar commented 1 year ago

And one another device we getting this issue, - Android

MicrosoftTeams-image

xsahil03x commented 1 year ago

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 commented 1 year ago

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?

ChiragGajjar commented 1 year ago

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

ChiragGajjar commented 1 year ago

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.

xsahil03x commented 1 year ago

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

kanat commented 1 year ago

Hi @ChiragGajjar,

Could you please share your app_id?

esarbanis commented 1 year ago

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 commented 11 months ago

People still report this issue on Android in the samples apps

ChiragGajjar commented 11 months ago

@esarbanis Any update on this issue? screenshot-1700737465421

ChiragGajjar commented 11 months ago

Here is the app ID:- 1198644

esarbanis commented 11 months ago

@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 commented 11 months ago

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

ChiragGajjar commented 11 months ago

I can't find out this methods on flutter.

client.updateAppSetting

esarbanis commented 11 months ago

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 commented 8 months ago

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

mednow-roman commented 8 months ago

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

esarbanis commented 8 months ago

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.

mednow-roman commented 8 months ago

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 commented 8 months ago

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

mednow-roman commented 8 months ago

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

esarbanis commented 8 months ago

@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 ...

github-actions[bot] commented 8 months ago

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

mednow-roman commented 7 months ago

Bump.

mednow-roman commented 7 months ago

@esarbanis Any update on this?

github-actions[bot] commented 6 months ago

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

mednow-roman commented 6 months ago

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
deven98 commented 5 months ago

@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.