Well, first of all, you definitely do not want to refer directly to the file. You will probably want to send the user a link to the service you created (or even to the page) with the generated id argument, which will lead to the download of the file if certain criteria are met.
These criteria are complex, because you need to allow the user to download the file more than once (in case he cannot download the full file for the first time or delete it accidentally, etc.), but after that it works until you kill him.
I would suggest using time or IP to filter download requests.
Time: when someone buys a file from you, let them know that they can only download the file for 1 day or some of them. Yes, other people can download the file during this day, but only for 1 day. You can also set a download restriction, so they can only download it 5 times (this is normal).
IP: When someone buys a file from you, tell them that they can only download the file from this IP address. The download service can, of course, verify this when they try to download the file.
It seems that both of them can be easily used at the same time.
In any case (or both), be prepared to contact clients who did not download the file on time, or want to receive it again after the deadline (or from another computer / IP (some people do not get static)). They will not want to pay again, and probably should not.
source share