Welcome Guest, Not a member yet? Register   Sign In
How to check if ‘userfile’ field is not empty before uploading a file?
#1

[eluser]pulok[/eluser]
How can I check if user has selected any file to upload (before calling the $this->upload->do_upload() in my controller)? This is needed because there are other input fields along with a file upload field which is optional. Basically what I want to do is:
Code:
if ( user_chose_any_file_to_upload ){
   // try to upload file
   if ( ! $this->upload->do_upload()){
      blah.. blah.. blah..
   }
}
#2

[eluser]ejangi[/eluser]
Deja vou - I could have sworn Michael Wales answered this here.
#3

[eluser]pulok[/eluser]
Thanks @ucantblamem.
Oops, sorry, It was posted twice :-(




Theme © iAndrew 2016 - Forum software by © MyBB