3 posts by 2 authors in: Forums > CMS Builder
Last Post: October 31   (RSS)


I am creating an upload field for a form. I would like to be able to use a JavaScript function that checks the allowed extensions.

Currently I am hardcoding the allowed file types:

		var types = ['application/vnd.ms-excel','application/msword','application/pdf','application/vnd.openxmlformats-officedocument.spreadsheetml.sheet','application/vnd.openxmlformats-officedocument.wordprocessingml.document'];
		for(var i=0;i<fs;i++){
	  	if(types.toString().indexOf(files[i].type) == -1) {
	  		error += 'Disallowed file type\n';

I would like to improve this by allowing the file types defined in cmsb section editor area but I am not sure how to access this array.

Can someone please advise?

Thank you,


Hi Daniel,

As always, you've been extremely helpful - thank you very much!