File Uploading Class
CodeIgniter's File Uploading Class permits files to be uploaded. You can set various preferences, restricting the type and size of the files.
The Process
Uploading a file involves the following general process:
- An upload form is displayed, allowing a user to select a file and upload it.
- When the form is submitted, the file is uploaded to the destination you specify.
- Along the way, the file is validated to make sure it is allowed to be uploaded based on the preferences you set.
- Once uploaded, the user will be shown a success message.
To demonstrate this process here is brief tutorial. Afterward you'll find reference information.
Creating the Upload Form
Using a text editor, create a form called upload_form.php. In it, place this code and save it to your applications/views/ folder: