aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/FileController.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/FileController.kt')
-rw-r--r--src/main/kotlin/FileController.kt7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/kotlin/FileController.kt b/src/main/kotlin/FileController.kt
index 528df3a..5586212 100644
--- a/src/main/kotlin/FileController.kt
+++ b/src/main/kotlin/FileController.kt
@@ -111,8 +111,11 @@ class FileController {
*/
fun upload(ctx: Context) {
ctx.uploadedFiles("file").forEach { (_, content, name, _) ->
- val path = "${ctx.splats()[0]}/$name"
- FileUtil.streamToFile(content, "$fileHome/${userHandler.getVerifiedUserId(ctx)}/$path")
+ val path = "${ctx.splats()[0]}/$name" // es gibt kein [content] bei nem dir
+ FileUtil.streamToFile(
+ content,
+ "$fileHome/${userHandler.getVerifiedUserId(ctx)}/$path"
+ ) // ich würde alle files aus der directory einzeln uploaden <- deshalb das (foreach)
databaseController.addFile(path, userHandler.getVerifiedUserId(ctx))
}
}