Welcome Guest, Not a member yet? Register   Sign In
File download problem

In my application, a person can by an ebook, when payment is completed a link to the file is send in email. By clicking on it an a function in controller is called which after validating a security code, renders view with the link to the file to download. By clicking on this link an other function is called which starts a download, I am using the php readfile method. the code for it is following,

header("Content-type: application/force-download");
header("Content-Transfer-Encoding: Binary");
header("Content-disposition: attachment; filename=\"".basename($file)."\"");

After this we have code that updates the database. Now my problem is that I want to run this code after the file is completely downloaded.

Can anyone help me with this.


Does anybody have any solution?


I have no solution for you but found a link to
a post where this problem was discussed. They
didn't come toa final solution but maybe you
get some hints ...


Theme © iAndrew 2016 - Forum software by © MyBB