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

[eluser]Unknown[/eluser]
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)."\"");
readfile("$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.


Messages In This Thread
File download problem - by El Forum - 02-04-2009, 07:16 AM
File download problem - by El Forum - 02-04-2009, 09:00 AM
File download problem - by El Forum - 02-04-2009, 10:40 AM



Theme © iAndrew 2016 - Forum software by © MyBB