preparing file download
This commit is contained in:
@@ -21,6 +21,7 @@ public class Constants {
|
||||
public static final String COMPANY = "company";
|
||||
public static final String COMPANY_ID = "company_id";
|
||||
public static final String CONTENT = "content";
|
||||
public static final String CONTENT_DISPOSITION = "Content-Disposition";
|
||||
public static final String CONTENT_TYPE = "Content-Type";
|
||||
public static final String CUSTOMER_NUMBER_PREFIX = "customer_number_prefix";
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ public class Constants {
|
||||
public static final String CONFIG_DATABASE = "umbrella.modules.document.database";
|
||||
public static final String CONFIG_TEMPLATES = "umbrella.modules.document.templates";
|
||||
public static final String CONTACTS = "contacts";
|
||||
public static final String CONTENT_DISPOSITION = "Content-Disposition";
|
||||
public static final String CUSTOMERS = "customers";
|
||||
|
||||
public static final String ERROR_ADDRESS_MISSING = "{0} address does not contain street address / post code / city";
|
||||
|
||||
@@ -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