preparing file download

This commit is contained in:
2025-09-29 08:48:18 +02:00
parent 2a9201ea9f
commit ea8f564145
3 changed files with 4 additions and 1 deletions

View File

@@ -103,6 +103,9 @@ public class FileModule extends BaseHandler implements FileService {
}
private boolean getFile(HttpExchange ex, File file) throws IOException {
var headers = ex.getResponseHeaders();
//headers.add(CONTENT_TYPE, MIME_PDF);
headers.add(CONTENT_DISPOSITION,"attachment; filename=\""+file.getName()+"\"");
return sendContent(ex,new FileInputStream(file));
}