CodeIgniter Forums
force_download not work? [FIXED] - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: force_download not work? [FIXED] (/showthread.php?tid=8495)



force_download not work? [FIXED] - El Forum - 05-20-2008

[eluser]Ahmed Nuaman[/eluser]
Hello everyone.

I was using 'force_download' method successfully until recently. There's been no major changes in my code that I can think of that may affect it.

This is the set up.

File is located here: /home/folder/datafiles/somefile.zip
HTML root is here: /home/folder/wwwroot/

So, my script enters the following variables into the 'force_download' function:

Code:
force_download('somefile.zip',file_get_contents('/home/folder/datafiles/somefile.zip'));

This, however, does not work. It causes the error in Mozilla browsers saying:
Quote:XXX could not be saved because the source file could not be read

Any ideas?


force_download not work? [FIXED] - El Forum - 05-22-2008

[eluser]saiprasad.ch[/eluser]
Maybe because the original file outside the "HTML Root".