hi guys! can anyone can help me with multipart for...
# ktor
v
hi guys! can anyone can help me with multipart form data? i have a ktor server endpoint which expects a two parts form data: form item and form data. I can send form item without any problems, but a cant findout a way to send file as PartData.FileItem thx
c
Are you suck on the server or the client side?
My implementation for the client-side can be found in this package (https://gitlab.com/clovis-ai/formulaide/-/tree/main/client/src/commonMain/kotlin/formulaide.client/files, see also the actuals). It works for JVM and JS, it should be easy to extend to other platforms. I do not know if this is the simplest way or not, but it works well.
a
You can find an example for uploading a file with multipart/form-data in the documentation.
c
@Aleksei Tirman [JB] that example is JVM-only (java.io.File)
a
I suppose the part with reading bytes from a file is easily replaceable.