How to hide a remote file download link? |
[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!
[eluser]codeartist[/eluser]
have you tried using this helper first ? http://ellislab.com/codeigniter/user-gui...elper.html
[eluser]Unknown[/eluser]
[quote author="codeartist" date="1353173503"]have you tried using this helper first ? http://ellislab.com/codeigniter/user-gui...elper.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 . |
Welcome Guest, Not a member yet? Register Sign In |