I am looking for away to allow a form to submitted with an empty file upload, as codeigniter seems to always require the file upload.
Can anyone tell me how to allow the file upload to be empty?
I am looking for away to allow a form to submitted with an empty file upload, as codeigniter seems to always require the file upload.
Can anyone tell me how to allow the file upload to be empty?
You can manually test the $_FILES superglobal for the error code 4 (no file). If the error code is not equal to 4, then upload the image. If it's equal to 4, just skip the uploading altogether.
if($_FILES['userfile']['error'] != 4){
// Do upload here
}
// userfile was empty...carry on as normal.