How can I check the size of an uploaded file to kt...
# ktor
a
How can I check the size of an uploaded file to ktor? Checked the documentation and searched here but surprised I couldn’t find something
My use case was to prevent users from uploading too large files. I realized I can do this with nginx.
c
I'm interested in the same thing.
a
You can get the number of bytes from the
Content-Length
header (if it's available) before receiving the body.
👍 1
c
That's a good first step, however the client could lie about it. If the client lies, will Ktor trust the value?
a
What do you mean by trusting the value?