bash autocomplete in scripts

Hello all,

I have a question regarding the auto-completion in bash scripts.How can I implement this feature into my scrips?
For example I wanna choose a file from a directory and I wanna use TAB to complete the names of the files from that directory.


printf "Provide the file: "
read -e inputfile

Thanks a lot!