Skip to content
Snippets Groups Projects
Commit 99e27a32 authored by S.Listl's avatar S.Listl
Browse files

1051583 - Bulkmail file type validation

parent 02c81d8d
No related branches found
No related tags found
No related merge requests found
......@@ -313,6 +313,10 @@
</entityParameter>
<entityField>
<name>templateType</name>
<valueProcess>%aditoprj%/entity/BulkMail_entity/entityfields/templatetype/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>templateData</name>
</entityField>
</entityFields>
<recordContainers>
......
//import("system.translate");
//import("Bulkmail_lib");
//import("system.result");
//import("system.vars");
//import("Document_lib");
//
//var bindata = vars.get("$local.value");
//if (bindata)
//{
// let mimeType = DocumentUtil.getMimeTypeFromUpload(bindata);
// if (!BulkMailUtils.isValidMimeType(mimeType))
// result.string(translate.text("Invalid file type"));
//}
import("system.translate");
import("Bulkmail_lib");
import("system.result");
import("system.vars");
import("Document_lib");
//TODO: this should be validated with the code above, waiting for ticket #1042587
\ No newline at end of file
var bindata = vars.get("$local.value");
if (bindata)
{
let mimeType = DocumentUtil.getMimeTypeFromUpload(bindata);
if (!BulkMailUtils.isValidMimeType(mimeType))
result.string(translate.text("Invalid file type; only .html, .eml and .txt are allowed"));
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment