Hi
I'm trying to upload a file (small) using ktor (android/iOS) ,
I can see some old snippet, any new flows ?
also are these right approaches
• pass base64 (platform) -> convert to ByteArray (common) -> make request
• pass file uri -> read file (expect/actual in common) -> ByteArray -> make request
h
hafiz
08/02/2024, 6:44 AM
any idea of this
a
Ahmed na
08/02/2024, 6:58 AM
hey @hafiz
This was last year, i think now there has to be a way to read ByteArray
i went with the bae64 approach since then, it was easy
create a helper class
Copy code
data class File(val name:String,val base64:String,val type:String?=null)
then just decode the base64 into byearray and send in ktor
h
hafiz
08/02/2024, 7:09 AM
@Ahmed na I have byteArray image from third party library give but problem is that this byteArray still can't upload to the server.
a
Ahmed na
08/05/2024, 8:51 AM
hi @hafiz
I've shared this under my core lib, see if it helps
it's need early access add this in your