Question

I'm working on a project that allow file uploads, the download file then forces the user to download the file.

the problem is, I have been using file_get_contents, which works fine, except for when allow_url_fopen is disabled, which is something I want to provide a workaround for.

in other cases I have had this issue, I've used cURL, which works well, but I'm wondering if it is safe to use it in this manner?

if cURL is a poor use for this, what other method would be a good way of getting a file's data for download?

just to throw this in, I'm using CodeIgniter 2, if that makes a difference.

Thanks

EDIT: to be clear on my problem, the files will always be local and located on the server the php code is on, this script will NEVER download remote data, which is why cURL seemed like bad usage, but file_get_contents is not an option either due to reason explained earlier.

Was it helpful?

Solution

I figured it out, I forgot all about fopen and fread.

that solved my problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top