convert-to: Set the mimetype in the responses.
Change-Id: Ib8dcad5f81499aec0ba147a3a4ef0b7a30995bcc
This commit is contained in:
parent
beffd4967a
commit
a59598050d
1 changed files with 5 additions and 0 deletions
|
@ -638,7 +638,12 @@ bool ClientSession::handleKitToClientMessage(const char* buffer, const int lengt
|
||||||
std::string encodedFilePath;
|
std::string encodedFilePath;
|
||||||
Poco::URI::encode(resultURL.getPath(), "", encodedFilePath);
|
Poco::URI::encode(resultURL.getPath(), "", encodedFilePath);
|
||||||
LOG_TRC("Sending file: " << encodedFilePath);
|
LOG_TRC("Sending file: " << encodedFilePath);
|
||||||
|
|
||||||
|
const std::string fileName = Poco::Path(resultURL.getPath()).getFileName();
|
||||||
Poco::Net::HTTPResponse response;
|
Poco::Net::HTTPResponse response;
|
||||||
|
if (!fileName.empty())
|
||||||
|
response.set("Content-Disposition", "attachment; filename=\"" + fileName + "\"");
|
||||||
|
|
||||||
HttpHelper::sendFile(_saveAsSocket, encodedFilePath, mimeType, response);
|
HttpHelper::sendFile(_saveAsSocket, encodedFilePath, mimeType, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue