chnpin
chnpin

Reputation: 21

How to track failed downloads in PHP?

I have collection of videos and audios in my server, where users can download by paying some amount.

Suppose user pay the amount for me and start the download but accidentally the download fails how can i detect that and i can provide him to download again.

The download link i provided is like rapidshare/megaupload/hotfile etc everytime unique. So once user downloaded the file link will die.

Update:

I want to provide the download link once after paying he can't download again and again by using the download key. Once download is completed even if he wants to download same thing he has to pay but if download fails then I can give to download again.

Upvotes: 2

Views: 301

Answers (3)

Dr.Molle
Dr.Molle

Reputation: 117334

I'm afraid there is no reliable way in PHP to determine if the download was successfull.

The only way that comes to my mind is a download-manager, an application that is able to look at the client's machine, if the download was successfully finished(and provide further download if not).

Upvotes: 0

metrobalderas
metrobalderas

Reputation: 5240

Your question is interesting, have you checked this question?

If it works, please update your original question to give the community something back.

Upvotes: 2

cbrandolino
cbrandolino

Reputation: 5883

The simplest way might be recording the video download permissions on the database and giving the user a new download link on request.

Upvotes: 1

Related Questions