Hi Andy,
I have checked the respective Forge component's client action i.e. GetFileCotentType and observed a small JS mistake which is causing this problem.
Change 1:
- I have replaced the document.querySelectorAll() with document.querySelector()
Change 2:
- The FileList object does have properties like name, size and the contents of the files.
- In the actual implementation the upload widget/file type input object is not referring the files property (object type) and thus the files object - length property value is undefined.
- Syntax: fileuploadObject.files
Working JavaScript Snippet:
if (window.FileReader && window.Blob) {
var uploadControl = document.querySelector('#' + $parameters.UploadId + ' > input[type="file"]');
var files = uploadControl.files; // this was missing
var contentTypes = [];
for(var i = 0; i < files.length; i++) {
contentTypes[i] = files[i].type;
}
$parameters.ContentTypes = JSON.stringify(contentTypes);
}
Hope this helps you!
Kind regards,
Benjith Sam