Codeigniter - Download a upload file in the directory Codeigniter - Download a upload file in the directory codeigniter codeigniter

Codeigniter - Download a upload file in the directory


For multiple files you have some alternatives, you can create each field as a user press a button or use the multiple propriety to <input> tag.

To manage this multiple uploads you must create your own upload library reading each $_FILES['nameoffield'] in a foreach loop for example although there are alternatives ready to be used like: https://github.com/nicdev/CodeIgniter-Multiple-File-Upload

On your database, you could have two fields that stores the original file name and path, and the encrypted one. Probably associated to a random unique number or timestamp.

To email encrypted link, and by encrypted I think you are saying a disguised link to the file, not using original name, you simple select the field which store the encrypted name to a controller, like download and keep a variable to receive a value as parameter. This value you must check on database if it really exists and then redirect to the file. By doing that you should have your file being downloaded.