I have a website where I sell software and application etc.
I was wondering how I could show the download link without the end user ebing able to share this link to other people, enabling them to download the file for free.
Thanks
I have a website where I sell software and application etc.
I was wondering how I could show the download link without the end user ebing able to share this link to other people, enabling them to download the file for free.
Thanks
Short answer: make the download a controlled, server-checked action rather than a plain URL and combine that with per-customer controls. asked how to stop casual sharing, and pointed in the right direction. Below are practical, implementable options that go beyond a simple “link” and help keep downloads accountable without killing legitimate users.
Store files outside the public web root and serve them through an authenticated endpoint that checks the purchaser, the allowed download count, and a short-lived cryptographic token. Example (illustrative) token flow:
# token generation (server-side)
import hmac, hashlib, time, base64
def make_token(file_id, user_id, secret, ttl=3600):
expiry = int(time.time()) + ttl
payload = f"{file_id}:{user_id}:{expiry}"
sig = hmac.new(secret.encode(), payload.encode(), hashlib.sha256).hexdigest()
return base64.urlsafe_b64encode(f"{payload}:{sig}".encode()).decode() On download, verify the token, check the user/order, decrement a download counter, and stream the file. Log every download (timestamp, IP, user-agent) to support dispute resolution.
Additional practical measures: use cloud/CDN signed URLs to offload bandwidth while keeping control; bind tokens to a user account or IP where useful; allow a small number of downloads and provide an account page for re-issuing; embed a per-customer identifier in installers (or watermark installers) for traceability; implement automated throttling and alerts for suspicious activity.
Cautions: no technical solution is 100% piracy-proof — installers can be rehosted, keys leaked, or screen-captured. Balance security with customer convenience. For high-value software, add activation/licensing checks (periodic phone-home), and keep clear logging and a support flow to reissue legitimate downloads.
Use an ecommerce package which can handle this for you. They tend to create a link that is stored in their database and triggers the formation of the page, but the code is timestamped to expire after a day or three. I also think they tend to mark it as having been used, to prevent sharing.
Cubecart can do this. The older version 3, which is free to download, can do this for you. You'd simply have a shop with only one product in it (or perhaps a couple of products)
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.