How to make file name and file type as parametric

I am having two fields now for capturing file name and file type. can I make these filels as parametric i.e it should get automatically. Is there any commnad/Lscript for doing this.Thanks.

Subject: How to make file name and file type as parametric

Get them automatically from where?