in logcat
what's the code that you're running to log the stacktrace?
its not stacktrace , its logcat
would you please share the full stacktrace?
java.lang.IllegalArgumentException: No subtype found for: ""
at okhttp3.MediaType$Companion.get(MediaType.kt:111)
at io.appwrite.Client.chunkedUpload(Client.kt:365)
at io.appwrite.services.Storage.createFile(Storage.kt:95)
at io.appwrite.services.Storage.createFile$default(Storage.kt:72)
at
Please use 3 backticks instead of 1 for multi line code
at okhttp3.MediaType$Companion.get(MediaType.kt:111)
at io.appwrite.Client.chunkedUpload(Client.kt:365)
at io.appwrite.services.Storage.createFile(Storage.kt:95)
at io.appwrite.services.Storage.createFile$default(Storage.kt:72)
at ```
at okhttp3.MediaType$Companion.get(MediaType.kt:111)
at io.appwrite.Client.chunkedUpload(Client.kt:365)
at io.appwrite.services.Storage.createFile(Storage.kt:95)
at io.appwrite.services.Storage.createFile$default(Storage.kt:72)
at ```
3 backticks also goes same
The formatting is a little different if you look closely
It seems input mime type is an empty string
but some image uploaded successfully without any error
yes
Because some images are passing the mime type
so what should we do?
Figure out when the mime type is empty and then fix it
its not true , i have printed mime type it gives mime type to both image
image/jpeg
what's yoru code?
val inputStream = contentResolver.openInputStream(PickedImageUri!!)
val mimeType = contentResolver.getType(PickedImageUri!!)
val source: BufferedSource = inputStream!!.source().buffer()
val byteArray = source.readByteArray()
Log.d("jnm",mimeType.toString())
userViewModel.saveImage(InputFile.fromBytes(byteArray!!, mimeType ?: "image/jpeg"))
}```
in here, before you create the file, would you please log file.mimeType?
image/jpeg comes
this comes in result
what's the new code?
it also looks like you're missing the file name argument to InputFile.fromBytes()
Recommended threads
- Flutter Android oAuth is no more working
I currently don't get the oAuth login to work in flutter android. it works on ios and on web. but when try to use it on Android, i get to the point where the ca...
- I'm experiencing a critical bug on Appwr...
Hey <@870607367597850624> team / support š I'm experiencing a critical bug on Appwrite Cloud that's blocking my production Flutter app. I've already filed GitH...
- Database listRows method call failing in...
I'm getting an error when trying to use listRows in a flutter app on a database. It seems something in the backend has changed because the production version of...