check if input file is set codeigniter 1

check if input file is set codeigniter

if (empty($_FILES['userfile']['name'])) {
}

Here is what the above code is Doing:
1. If the user has uploaded a file, the script checks to see if the file is an image file.
2. If the file is an image file, the script checks to see if the file already exists in the uploads directory.
3. If the file does not exist, the script checks to see if the file is the proper MIME type.
4. If the file is the proper MIME type, the script checks to see if the file is within the size limit.
5. If the file is within the size limit, the script checks to see if the file was completely uploaded.
6. If the file was completely uploaded, the script checks to see if a non-empty file was uploaded.
7. If a non-empty file was uploaded, the script checks to see if the file can be moved to the final destination.
8. If the file can be moved to the final destination, the script checks to see if the file already exists in the uploads directory.
9. If the file does not exist in the uploads directory, the script adds the file details to the database.
10. If the user has not uploaded a file, the script does nothing.

Similar Posts