convert-to: Set the mimetype in the responses.

Change-Id: Ib8dcad5f81499aec0ba147a3a4ef0b7a30995bcc
This commit is contained in:
Jan Holesovsky 2017-08-02 18:55:43 +02:00
parent beffd4967a
commit a59598050d

View file

@ -638,7 +638,12 @@ bool ClientSession::handleKitToClientMessage(const char* buffer, const int lengt
std::string encodedFilePath;
Poco::URI::encode(resultURL.getPath(), "", encodedFilePath);
LOG_TRC("Sending file: " << encodedFilePath);
const std::string fileName = Poco::Path(resultURL.getPath()).getFileName();
Poco::Net::HTTPResponse response;
if (!fileName.empty())
response.set("Content-Disposition", "attachment; filename=\"" + fileName + "\"");
HttpHelper::sendFile(_saveAsSocket, encodedFilePath, mimeType, response);
}