Welcome Guest, Not a member yet? Register   Sign In
Optional file upload
#10

[eluser]gtech[/eluser]
[quote author="PermanaJ" date="1245342070"]whoops ... I handle which one from $upload_error or $photo exist .. if $upload_error, then show error and stop processing form .. I just need to continue processing form even there are $upload_error[/quote]

your right but your code suggests that it should not pass the first if statement

have you tried

Code:
if ($_FILES['photo']['name']!="") {
    if( !$this->upload->do_upload('photo')){
        $upload_error = $this->upload->display_errors();
    }else{
        $photo = $this->upload->data();
    }
};

that way you can keep the display errors in if the upload fails when there is a file to upload.


Messages In This Thread
Optional file upload - by El Forum - 06-18-2009, 03:11 AM
Optional file upload - by El Forum - 06-18-2009, 03:28 AM
Optional file upload - by El Forum - 06-18-2009, 03:42 AM
Optional file upload - by El Forum - 06-18-2009, 03:43 AM
Optional file upload - by El Forum - 06-18-2009, 03:45 AM
Optional file upload - by El Forum - 06-18-2009, 03:53 AM
Optional file upload - by El Forum - 06-18-2009, 04:01 AM
Optional file upload - by El Forum - 06-18-2009, 05:21 AM
Optional file upload - by El Forum - 06-18-2009, 12:31 PM
Optional file upload - by El Forum - 06-18-2009, 06:50 PM



Theme © iAndrew 2016 - Forum software by © MyBB