Poohrang
09/12/2020, 2:38 PMhttp://www.domain.com/images/pic.png▾
Big Chungus
09/12/2020, 2:43 PMBig Chungus
09/12/2020, 2:43 PMPoohrang
09/12/2020, 2:49 PMBig Chungus
09/12/2020, 2:58 PMPoohrang
09/12/2020, 4:21 PM/* POST */
post("/uploadFile") {
val dir = File("D:\\carrotmarket_backend\\used_images\\${nickName}\\$id\\")
}
The received files are stored in like d:\\carrotmargeeet\\used_backeend\\csh0303\\10\\item.png
• csh0303 : my nickname
• 10 : item number
• item.png : filename
These values are dynamically decided at each time.
/* STATIC */
static("/static") {
staticRootFolder = File("D:\\carrotmarket_backend")
static("used_images") {
static("csh0303") {
files("10")
}
}
}
According to ktor.io website, I can change static foldeer by using staticRootFolder.
and then to reach sub-folder, I used multi static above code.
Although, I tried many times and changed URL in browser. It's still not working.
Is there any problem in my understanding and investigation?
I hopefully want to know specific URL for this.
Thanks.Big Chungus
09/13/2020, 12:03 AMBig Chungus
09/13/2020, 12:05 AMBig Chungus
09/13/2020, 12:07 AMBig Chungus
09/13/2020, 12:09 AMBig Chungus
09/13/2020, 12:09 AMPoohrang
09/13/2020, 2:47 PMstatic("/static") {
defaultResource("index.html")
staticRootFolder = File("D:\\carrotmarket_backend")
files(".")
}
I could check and see resources(html and png) in client side. Awesome!
But I couldn't fully understand why it works properly 😞
Anyway Thanks again.Big Chungus
09/13/2020, 2:49 PMBig Chungus
09/13/2020, 2:49 PMBig Chungus
09/13/2020, 2:49 PM