File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/main/kotlin/server/endpoints/contact Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ object ReportIssueEndpoint : EndpointBase("/report") {
2929 var name: String? = null
3030 var email: String? = null
3131 var message: String? = null
32- val attachments = mutableListOf< File >()
32+ val attachments = mutableMapOf< String , File >()
3333
3434 receiveMultipart(
3535 forEachFormItem = { item ->
@@ -44,7 +44,7 @@ object ReportIssueEndpoint : EndpointBase("/report") {
4444 deleteOnExit()
4545 }
4646 partData.saveFile(tempFile)
47- attachments.add( tempFile)
47+ attachments.set(partData.name ? : tempFile.name, tempFile)
4848 },
4949 )
5050
@@ -69,12 +69,12 @@ object ReportIssueEndpoint : EndpointBase("/report") {
6969 name?.let { replyTo?.name = it }
7070 replyTo?.let { setReplyTo(it) }
7171
72- attachments.forEach { file ->
72+ attachments.forEach { (name, file) ->
7373 addAttachments(
7474 Attachments ().apply {
7575 content = file.readBytes().encodeBase64()
7676 type = " application/octet-stream"
77- filename = file. name
77+ filename = name
7878 disposition = " attachment"
7979 }
8080 )
You can’t perform that action at this time.
0 commit comments