diff options
author | Marvin Borner | 2019-04-17 18:28:04 +0200 |
---|---|---|
committer | Marvin Borner | 2019-04-17 18:28:04 +0200 |
commit | ff98bebada6b000b83259e5ebde48b2deb3a4afd (patch) | |
tree | 19f8557eab4c604ea7bd63b833e221166136b07a /src/main/kotlin | |
parent | b8e81e52f4e12186455b6d17b378f29383d7ce88 (diff) |
Added recursive directory upload algorithm
Co-authored-by: LarsVomMars <lars@kroenner.eu>
Diffstat (limited to 'src/main/kotlin')
-rw-r--r-- | src/main/kotlin/FileController.kt | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/kotlin/FileController.kt b/src/main/kotlin/FileController.kt index 5586212..29706b1 100644 --- a/src/main/kotlin/FileController.kt +++ b/src/main/kotlin/FileController.kt @@ -110,12 +110,12 @@ class FileController { * Saves multipart media data into requested directory */ fun upload(ctx: Context) { - ctx.uploadedFiles("file").forEach { (_, content, name, _) -> - val path = "${ctx.splats()[0]}/$name" // es gibt kein [content] bei nem dir + ctx.uploadedFiles("file").forEach { (contentType, content, name, extension) -> + val path = "${ctx.splats()[0]}/$name" 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)) } } |