I am developing a shopping cart solution which will allow users to by some music online. Once the user successfully complets the payment he should be able to download an MP3 file. Any suggestion how can implement this functionality.
Basically It should be as follows
1.) Only the user who paid for it only able to download it.
2.) The download link corresponding to the user should expire after some time. But i want to keep the file in the same path as other users will have a download link for it.
Anthony provided a great example here, however I just have to point out that the operation of serving files trough PHP might be slow for larger volume website.