Get File Encoded URL

Hi,I appreciate it if you kindly tell me what shall I do if:
I want to get the encoded file URL for a
Table Name: cms_files
Key Field of this table: FileId
File Name Field: FileNameI would like to have a code like this:
File Download For Key1

View the HTML source of the link for the file in your browser. The URL is built from the file name, not from the key field. The URL also depends on the advanced setting “Encrypt file path”.