Assistant required - Notallowederror: security settings prevent access to this property or method
hey guys
another notallowederror quesiton, can please assist? i'm new livecycle , coding in general, assistant appreciated.
within form there's 'add attachement question', following message pop when button clicked
acrobat escript built-in functions version 10.0
acrobat soap 10.0
notallowederror: security settings prevent access property or method.
doc.importdataobject:13:xfa:form[0]:supportingdocs_pg[0]:supportingdocs2_sf[0]:smallattach s_sf[0]:btnadd[0]:click
form.supportingdocs_pg.supportingdocs2_sf.smallattachs_sf.btnadd::click - (javascript, client)
// attach file
var lodoc = event.target;
var loattachs = lodoc.dataobjects;
var lvattachsnum = 0;
if (loattachs != null)
{
lvattachsnum = loattachs.length;
}
var lv_aname = "attach" + (lvattachsnum + 1); lodoc.importdataobject(lv_aname); var loattach = lodoc.getdataobject(lv_aname);
var filename = loattach.path; // check file extension
var fileext = filename.substring(filename.lastindexof(".")).touppercase();
var max_size = 2097152; //2mb var size = loattach.size;
//xfa.host.messagebox("size"+size);
if (size > max_size)
{
xfa.host.messagebox("use large attachment option. attachment larger 2mb cannot attached in window. ");
lodoc.removedataobject(lv_aname);
}
else if (fileext == null ||
fileext == "" || (
fileext != ".avi" &&
fileext != ".bmp" &&
fileext != ".bpmn" &&
fileext != ".doc" &&
fileext != ".dot" &&
fileext != ".docx" &&
fileext != ".dotx" &&
fileext != ".drw" &&
fileext != ".eml" &&
fileext != ".eps" &&
fileext != ".gif" &&
fileext != ".jpg" &&
fileext != ".mp3" &&
fileext != ".mp4" &&
fileext != ".mpeg" &&
fileext != ".mpg" &&
fileext != ".mpp" &&
fileext != ".msg" &&
fileext != ".notebook" &&
fileext != ".odt" &&
fileext != ".ott" &&
fileext != ".sxw" &&
fileext != ".stw" &&
fileext != ".pdf" &&
fileext != ".xdp" &&
fileext != ".cp" &&
fileext != ".png" &&
fileext != ".ppt" &&
fileext != ".pot" &&
fileext != ".pptx" &&
fileext != ".potx" &&
fileext != ".pub" &&
fileext != ".rtf" &&
fileext != ".tif" &&
fileext != ".tiff" &&
fileext != ".txt" &&
fileext != ".url" &&
fileext != ".vsd" &&
fileext != ".wav" &&
fileext != ".wma" &&
fileext != ".wmv" &&
fileext != ".xls" &&
fileext != ".xlt" &&
fileext != ".xlsx" &&
fileext != ".xltx"))
{
var lvmsg = "attachments of type not accepted. file type:" + fileext;
app.alert(lvmsg);
lodoc.removedataobject(lv_aname);
}
else
{
var filename2 = loattach.path;
xfa.form.form.supportingdocs_pg.supportingdocs2_sf.smallattachs_sf.listbox1.additem(filen ame2, lv_aname);
}
thanks guys
van
do error acrobat, or reader?
More discussions in JavaScript
adobe
Comments
Post a Comment