CodeIgniter Forums
File download problem - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: File download problem (/thread-15425.html)

File download problem - El Forum - 02-04-2009

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.

File download problem - El Forum - 02-04-2009


Does anybody have any solution?

File download problem - El Forum - 02-04-2009


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 ...