Question
Customer has a requirement to restrict import of *.jar files from Add Resources > File > Secure file context menu in the repository .
Solution
TIBCO JasperReports® Server uses file extension validation for each resource type, defined in a JavaScript file resource.add.files.js located in jasperserver-proscriptsruntime_dependenciesjrs-uisrc for v.7.2.0 jasperserver-proscriptsruntime_dependenciesjrs-uisrcresource for v.7.5.0 typetoExtMap object: typeToExtMap: { 'accessGrantSchema': ['xml'], 'css': ['css'], 'font': ['ttf'], 'img': ['jpg', 'jpeg', 'gif', 'bmp', 'png'], 'jar': ['jar'], 'jrxml': ['jrxml'], 'olapMondrianSchema': ['xml'], 'prop': ['properties'], 'jrtx': ['jrtx'], 'xml': ['xml', 'agxml'], 'config': ['config'], 'cer': ['p12', 'pfx'], 'contentResource': ['docx', 'doc', 'ppt', 'pptx', 'xls', 'xlsx', 'ods', 'odt', 'odp', 'pdf', 'rtf', 'html', 'txt', 'csv', 'json'], 'secureFile': ['*'] }
For secure file, uploading files with any extensions allowed: "secureFile": ["*"]
You can change the property value to specify a comma separated list of valid extensions for secure file.
As TIBCO JasperReports® Server uses optimized version of scripts, you should rebuild the scripts as described in Ultimate Guide:
or add _opt=false parameter to the URL to use non-optimized scripts:
Why my JavaScript customized solution does not work?
Solution tested with TIBCO JasperReports® Server v.7.2.0 , 7.5
AS-20200228, case 01805477
Recommended Comments
There are no comments to display.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now