arunpatal Posted April 1, 2014 Share Posted April 1, 2014 Hi, I am uploading multiple files <form enctype="multipart/form-data" method="post"> <input type="file" name="gallery[]" multiple="multiple" /> <input type="submit" value="Update" name="gallery_submit" /> </form> But if not empty statement is not working with it if (!empty($_FILES["gallery"]["name"])){ $mysql->upload_gallery_img($gallery1); } I want that when file is selected then only the upload_gallery_img function runs Link to comment https://forums.phpfreaks.com/topic/287442-uploading-multiple-files/ Share on other sites More sharing options...
arunpatal Posted April 1, 2014 Author Share Posted April 1, 2014 Ok the problem was solved like this $add_gallery = array_filter($_FILES["gallery"]["name"]); if(!empty($add_gallery)) { code } else { }; Link to comment https://forums.phpfreaks.com/topic/287442-uploading-multiple-files/#findComment-1474617 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.