![]() |
How to hide a remote file download link? - 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: How to hide a remote file download link? (/showthread.php?tid=55932) |
How to hide a remote file download link? - El Forum - 11-17-2012 [eluser]Unknown[/eluser] Hey all, I've started using codeigniter a few weeks ago and so far, I'm loving it! To get to the point: I have an upload/download script. Files are uploaded to my VPS (other server), while the script is on a shared hosting. The link to the file is saved in the database. I want users to download the file without viewing my VPS' link/real file location. A method would be CURL I thought, I used some tutorials and it never seems to work. Problem: I get gibberish on the screen because the header type is never correct, even if I put image/png it will show gibberish instead of the image. My code is here: (where forced to be image/png to test with pngs which actually didn't work) Code: function download_file($file) Thanks! How to hide a remote file download link? - El Forum - 11-17-2012 [eluser]codeartist[/eluser] have you tried using this helper first ? http://ellislab.com/codeigniter/user-guide/helpers/download_helper.html How to hide a remote file download link? - El Forum - 11-17-2012 [eluser]Unknown[/eluser] [quote author="codeartist" date="1353173503"]have you tried using this helper first ? http://ellislab.com/codeigniter/user-guide/helpers/download_helper.html[/quote] Awesome, looks just like what I need! Thanks ![]() Edit: INevermind it does work! Turns out CURL was echoing the contents which was why headers were already sent ![]() |