Load and attach a file
It may be necessary to upload files into the database and attach this file to a selected record.
First the ID list of all selected records is created. Then function UploadFile() is loading the file and attaching it to the first selected record.
The name of the table and the name of the FileLink filed must also be provided.