Image force_download problem - 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: Image force_download problem (/showthread.php?tid=42115) |
Image force_download problem - El Forum - 05-26-2011 [eluser]veledrom[/eluser] Hi, I can upload and download the image but when I open downloaded image, nothing shows up. It says "no preview". However, I can access the image through browser by typing the path. Code: public function do_downloadfile() Upload folder is under main root. http://localhost/CI/upload/12743552b2871fa70d790782885dd6fe.JPG Is file being corrupted when downloaded? Neither fopen() nor file_get_contest() work... Thanks Image force_download problem - El Forum - 05-26-2011 [eluser]toopay[/eluser] Code: force_download($name, $exist); Image force_download problem - El Forum - 05-27-2011 [eluser]veledrom[/eluser] Sorry I was testing with many possibilities. It is actually Code: force_download($name, $data); Image force_download problem - El Forum - 05-27-2011 [eluser]Unknown[/eluser] So far,So good. Image force_download problem - El Forum - 05-27-2011 [eluser]veledrom[/eluser] I added my controller and view file for you to have a better idea. Please help me I am desperate to do this. Upload and download successful but the image I download later on is corrupted I think. Nothing shows up. Thanks Note: Just create a folder called "upload" in main root of CI. |