you need to use server validation from either Form toolkit or CSS Form builder for this.
for File type, use File Extension validation. For the Server varaible, expand the form collection and select the File Filed form element (the firsst plain one, not one that has a lightning bolt next to it.
for file size, select number validation, for the server variable, click the lightning bolt, expand the form collection and select the File Filed File Size variable.
Set the maximum to 500