How to set to upload only PDF files on fieldtype Attach

Hi all,
I have the below code and trying to have only PDF files
this.upload_file_select = this.page.add_field({
fieldname:“upload_file”,
fieldtype: “Attach”,
options: {‘accept’:‘application/pdf’},
allowed_file_types: [“application/pdf”],

I see that options and allowed_file_types does not work…
if i use html on Develop
$(‘input[type=file]’)[0].accept = ‘application/pdf’
It will work but when added to the code because i cannot add the load event (don’t know actually) the code is not executed…

Any one with a clue of how to set this $(‘input[type=file]’)[0].accept = ‘application/pdf’ so it will show only PDF files ?

:slight_smile:

Use this custom app

2 Likes

Thanks for the tip.
But i’m still on V12

Thank you again for sharing…
Managed to backport to V12 as i said here…