![]() |
Download helper, using force_download() - file corrupt after opening it - 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: Download helper, using force_download() - file corrupt after opening it (/showthread.php?tid=52690) |
Download helper, using force_download() - file corrupt after opening it - El Forum - 06-21-2012 [eluser]Brad K Morse[/eluser] I manually uploaded files to a server using Transmit, auto detect (file settings). Then I use the download helper lib to force download the file when a user clicks on a link, which ties to the file's ID in the database. If I go directly to the file URL path, for example: domain.com/directory/file.pdf, it shows up fine in the browser. When I click the link that downloads that same file to my desktop, then I open it, it says it is corrupted. This happens to all the files. What might be possible causes to this problem? Code: $this->load->helper('download'); Download helper, using force_download() - file corrupt after opening it - El Forum - 06-21-2012 [eluser]Otemu[/eluser] Hi, If you can copy the link for download and it opens in your browser then there a chance it could be that the adobe package is corrupted on your desktop. Try download the file again but instead of using adobe to open it use your web browser instead. Download helper, using force_download() - file corrupt after opening it - El Forum - 06-21-2012 [eluser]Brad K Morse[/eluser] Thanks! I think that was the problem. Worked fine in Firefox and in IE, but not Chrome for my Mac. Download helper, using force_download() - file corrupt after opening it - El Forum - 08-16-2012 [eluser]zwadder[/eluser] I had a problem with downloading xls files, they were corrupted. This did fix it: http://www.innovativephp.com/image-downloading-issue-codeigniter-download-helper/ only added the ob_clean() part to the download_helper and it works now fine. Only when there is an update I will lose it :-( Download helper, using force_download() - file corrupt after opening it - El Forum - 08-16-2012 [eluser]NeoArc[/eluser] Try using FCPATH instead of base_url(). |