Sure, you can use PayPal's IPN service to permit the download once payment has been confirmed.
* Create a database record, indicating purchased file, hashing users IP and browser agent, add a cookie too
* Send to PayPal for payment
* Provide user a unique URL for this download
* Once payment has been confirmed, enable download in database for set period of time
That's usually the, very rough, gist of it.
Get the download where the browser and ip is the
same as the user who paid, and has the cookie value,
and is paid for, and where the number of downloads
is less than or equal to 2.
$sql = sprintf(
paid = 1
ua = '%s'
ip = '%s'
hash = '%s'
downloads <= 2;",