preparing file download
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user