Hi guys,
Just thought we'd share this Scriptlet we got working for checking document size before it is uploaded to AwareIM. I.e. the size is checked when the document is selected.
You can put it in the Advance Initialization Script of the Form and change the size and message. Works like a charm for us:
for (var i = 0; i < widgets.length; ++i) {
if (widgets[i].type == "upload") {
widgets[i].config.select = function onSelect(e) {
$.each(e.files, function (index, value) {
if (value.size > 5000000) {
e.preventDefault();
alert("Document too large (>5mb) - please resize the document and try again.");
}
});
};
}
}