Welcome Guest, Not a member yet? Register   Sign In
Multi Upload return TRUE
#1

Hi CI Members,

I have issue when I submit form without upload any image and system not detect the input is empty,
But when I remove "[]" in name is work.

I hope CI Members can help me to solve my issue.

Code:
<input type="file" class="form-control-file" id="preview_image" name="preview_image[]" multiple>


PHP Code:
if (isset($_FILES['preview_image']['name'])
 
       && ($_FILES['preview_image']['name'] != '' || is_array($_FILES['preview_image']['name']) && count($_FILES['preview_image']['name']) > 0)) {
 
       if (!is_array($_FILES['preview_image']['name'])) {
            
            
//Upload Code
    
}

 
   return (bool) $totalUploaded

Thanks you...
Reply


Messages In This Thread
Multi Upload return TRUE - by googlemy - 05-05-2019, 02:12 AM
RE: Multi Upload return TRUE - by InsiteFX - 05-05-2019, 04:46 AM



Theme © iAndrew 2016 - Forum software by © MyBB