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.kt6
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))
}
}