Welcome Guest, Not a member yet? Register   Sign In
Upload display errors
#1

[eluser]Adnan1984[/eluser]
Hi,
i have made upload program code. it is fine with me but a little bit confused. I put $this->upload->display_errors() and i got message when i clicked submit. it says
Quote:You did not select a file to upload.
. it means that Required so i do not want it. Any idea?

Thanks
#2

[eluser]LuckyFella73[/eluser]
Check first if a file was selected, if yes that call
the file upload library:

Code:
// assuming your input field (type file) has the name "userfile"
if ( isset($_FILES['userfile']['name']) AND strlen($_FILES['userfile']['name']) > 3 ){
if ( ! $this->upload->do_upload()) // ... upload code here
}
#3

[eluser]Adnan1984[/eluser]
Thanks a lot. this code is really good. Smile




Theme © iAndrew 2016 - Forum software by © MyBB