https://kotlinlang.org logo
#moko
Title
# moko
m

mangubatrj

10/18/2023, 3:19 AM
Hello good day everyone! Is there a way to convert Bitmap to
NSData
using moko-media? Or at least get the file path or name of the Bitmap? as I am currently trying to use the library to get image from gallery/camera and then upload it multipart via Ktor.
m

mangubatrj

10/18/2023, 6:44 AM
hello @alex009 thank you so much for replying. 🙇 I ended up using instead:
Copy code
mediaPickerController.pickMedia()
Because I needed the file `path`/`name` to be uploaded via multipart. It is kind of working for the Gallery. But may I ask how should I do this via Camera? as I really need the file `path`/`name` for the upload part.
a

alex009

10/18/2023, 10:45 AM
when you do
pickImage
just save
Bitmap
to file with
okio
(read
ByteArray
and write with
okio
)
m

mangubatrj

10/18/2023, 12:57 PM
okay @alex009 thank you for this. I will implement it like that. Again, Thank you very much! 🙇
3 Views