Validate file before saving

Hi, is there a way to validate the file attachment before saving? Example, I only want files in docx or pdf format.

Hello Wendy,

First of all, you cannot obtain the attachment file name or info by “app.record.create.submit” or “app.record.edit.submit.”

However, by using the DOM manipulation (document.getElementsByClassName), you can obtain the attachment file name, so make a script that cancels the saving process if it’s a file that you do not want to save.

FYI, be aware that Kintone does not recommend the DOM manipulation because it might not suddenly work one day after maintenance if the DOM structure changes.