https://kotlinlang.org logo
#ktor
Title
# ktor
o

Ovsyannikov Alexey

02/07/2022, 3:31 PM
Hello 🙂 is there any way to upload multipart forms with large files from js? As I understand, by default in JS is used
window.fetch
, but I didn't found any way in ktor to upload files as streams
a

Aleksei Tirman [JB]

02/08/2022, 7:31 AM
Unfortunately, this isn't feasible right now because the only supported primitive for streaming is
Input
and it's synchronous, which makes it impossible to implement in the browser environment.
o

Ovsyannikov Alexey

02/09/2022, 10:35 AM
Ok, I see. Thanks
a

Aleksei Tirman [JB]

02/09/2022, 10:36 AM
In theory, this could be done in the Web Workers environment.
o

Ovsyannikov Alexey

02/09/2022, 12:10 PM
Is there some hope that Ktor clients will achieve some additional method for JS with files? As I understand, it is possible to make stream-like upload via fetch api
3 Views