[eluser]CroNiX[/eluser]
When you upload a file using the upload helper, store it on the server and also get the filename and put in the database.
Code:
if ($this->upload->do_upload())
{ //upload was successful, grab the filename and insert in db
$file_info = $this->upload->data();
$this->db->insert('table', array('filename' => $file_info['file_name']));
}
else
{
//there was an upload error
}
On the page where someone can download a file, just grab the filenames from the db and create links for them.
Code:
<?php foreach($files as $file): ?>
<div><a href="/path/to/file/<?php echo $file['filename']; ?>"><?php echo $file['filename']; ?></a></div>
<?php endforeach; ?>
There is no reason to use file_get_contents() and manually send it to the browser unless you don't want the user to know the path to the file. Clicking on the actual link to the file will do the same thing and just download the file.
The above is just a very basic sample to give you the concept.