CodeIgniter Forums
Easier Way to Download Files? - 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: Easier Way to Download Files? (/showthread.php?tid=59933)



Easier Way to Download Files? - El Forum - 12-11-2013

[eluser]ShoeLace1291[/eluser]
So... I have a form on my application that users use to upload their resume to my server. In my administrator panel, I need to be able to open these files with a link. I would just open the files directly, however, there are other people that need access to these files as well but do not have ftp access.

I encountered many problems along the way with the download helper. With word files(doc, docx), the downloaded file opens with a bunch of random characters on every page. I did a test run with a file from my own computer. I uploaded it and then opened it with the controller, but it was, again, just a bunch of random characters. The real file was only 3 pages long. In the doc that I downloaded, some pages had a couple lines, others had a full page of random characters.

I also tried using the FTP class with the download function. Apparently that just downloads from the specified remote path and then saves it to the specified local path(e.g. the server, not the client's computer).

I am giving users the option to upload txt, doc, docx, rtf, and pdf files. Is there a method that would work for all of those file types?


Easier Way to Download Files? - El Forum - 12-12-2013

[eluser]Massaki[/eluser]
Are you using force_download()?


Easier Way to Download Files? - El Forum - 12-14-2013

[eluser]ShoeLace1291[/eluser]
[quote author="Massaki" date="1386849008"]Are you using force_download()?[/quote]

Yes, that's what I mean by download helper. Why can't I just download a file directly instead of getting the contents of the file and creating a new one?


Easier Way to Download Files? - El Forum - 01-14-2014

[eluser]ShoeLace1291[/eluser]
bump


Easier Way to Download Files? - El Forum - 01-14-2014

[eluser]InsiteFX[/eluser]
KFM File Manager