assign "Extensions to allow" Attribute to a document field

Is there a way to access to a document field and assign “Extensions to allow” Attribute?

I have try do it like this

In field Attributes:
I have set “Extensions to allow” to {myExt}
In form onload event :
{myExt}=?txt;.txt? ;

but it gives error message ?invalid file type? when i try to upload a txt file.

What you might try (as I think you are using a file upload) is to set a global variable in the ‘extensions to allow’ field, i.e. [myext].
Then set the global to your extensions [myext]=‘txt;pdf’;

This assignment needs to be done before using the field so an onscriptinit would do.

there is such option in the field setting itself!

Yes there is. Just choose the right fieldtype. (upload)

This doesn’t work anymore. Using a global returns an error. Any other suggestions?

Report to SC and hope for the best I’m afraid. They might have changed it, but it also could be a simple bug.