https://kotlinlang.org logo
#compose-ios
Title
# compose-ios
m

mangubatrj

10/16/2023, 4:43 PM
Hello has anyone tried to upload file/image for IOS? How to save the image in disk before calling API? Currently I am using a ktor client to upload an image via multipart.
c

Cherrio LLC

10/16/2023, 11:31 PM
Can you give more context…
m

mangubatrj

10/17/2023, 12:21 AM
hi @Cherrio LLC thanks for replying. I am trying to use a ktor client to upload an image via multipart. Currently I tried to follow this from the channel: https://kotlinlang.slack.com/archives/C3PQML5NU/p1591158232264800?thread_ts=1591156286.264700&cid=C3PQML5NU But I am a bit stuck on saving the file/image in the IOS platform. Do you have any idea how to do it?
c

Cherrio LLC

10/17/2023, 10:11 PM
You don’t have to save the file on disk.
Just get the image data as
NSData
then convert it to
bytearray
then send upload it using Ktor