<Why Spring kills file's encoding during downloadi...
# stackoverflow
u
Why Spring kills file's encoding during downloading? I have the following code: @Throws(IOException::class) private fun convertInputStreamToString(`is`: InputStream): String? { val result = ByteArrayOutputStream() val buffer = ByteArray(DEFAULT_BUFFER_SIZE) var length: Int while (
is
.read(buffer).also { length = it } != -1) { result.write(buffer, 0, length) } return result.toString("windows-1251") } @RequestMapping(path = ["/download/{id}"], method =...