Merge pull request #7400 from riadvice/fix-filename-download-encoding

Fix downloaded file encoding.
This commit is contained in:
Anton Georgiev 2019-05-09 13:41:35 -04:00 committed by GitHub
commit 0522b2ce87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,6 +20,9 @@ package org.bigbluebutton.web.controllers
import grails.converters.* import grails.converters.*
import org.bigbluebutton.api.ParamsProcessorUtil; import org.bigbluebutton.api.ParamsProcessorUtil;
import java.nio.charset.StandardCharsets
import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.FilenameUtils;
import org.bigbluebutton.web.services.PresentationService import org.bigbluebutton.web.services.PresentationService
import org.bigbluebutton.presentation.UploadedPresentation import org.bigbluebutton.presentation.UploadedPresentation
@ -296,7 +299,7 @@ class PresentationController {
def bytes = pres.readBytes() def bytes = pres.readBytes()
def responseName = pres.getName(); def responseName = pres.getName();
response.addHeader("content-disposition", "filename=$responseName") response.addHeader("content-disposition", "filename=" + URLEncoder.encode(responseName, StandardCharsets.UTF_8.name()))
response.addHeader("Cache-Control", "no-cache") response.addHeader("Cache-Control", "no-cache")
response.outputStream << bytes; response.outputStream << bytes;
} else { } else {