I am new to codeigniter. I have to implement the feature of uploading a file and downloading the file to the desktop. The question is the each user maintains his/her own files. How do I link the files to the user. The video from nettuts explains of saving the file to a folder in the harddisk but does not tell who has uploaded the file. Do I have to upload the file to database to link it to the user or is there any procedure to upload the file to the folder and the descriptor is saved to the database which links the user with the uploaded files.
Thanks in advance
If you are using the CodeIgniter File Uploading class
then you can just set the $config['upload_path'] = './uploads/'.$username;
and it will upload into that directory (you need to make sure you create the directory and have permissions).
then add the saved filename to your db entry. It can be obtained using:
$imagedata = $this->upload->data();
$filename = $imagedata['filenane']; // the filename
$path = $imagedata['full_path']; // the file system path to the file