Greetings, I'm trying to serve static files (from ...
# ktor
r
Greetings, I'm trying to serve static files (from resources folder), it works properly according to the (guide)[https://ktor.io/docs/serving-static-content.html#defining-a-default-resource]. However, the filename is changed to
download
and I would like to keep the original one.
Copy code
routing {
        static("/download") {
            defaultResource("distributive/loottherun-desktop-0.10.29.zip")
        }
    }
So when I go to
localhost:8080/download
I see that browser "downloads"
download
file. It is the same as my zip, but naming is wrong. How I can keep the right naming? Tried to play around arguments in defaultResource method, but didn't work.
a
You can either change the `static`'s route path to
/download/loottherun-desktop-0.10.29.zip
or serve all resource from a desired package
Copy code
static("/assets") {
    resources("distributive")
}
r
Is there a way to do that even while hosting it at
/download
? I.e. using the
Content-Disposition
header
a
With the
defaultResource
, no.