0) { $new_file_name=($mysql_insert_id.$new_file_name); $insert = mysql_query("INSERT INTO tbl_job_img(`old_name`, `new_name`) VALUES('".trim( addslashes($new_file_name_3730) )."','".trim( addslashes($new_file_name) )."')"); } $prod_img = $filedir.$new_file_name; // original_images/456546565465465464jhh.jpg $items[] = $prod_img; /*$prod_img_thumb = $thumbdir.$mysql_insert_id.$i.$getExt[0].".".$getExt[1]; $new_file_name = $mysql_insert_id.$i.$getExt[0].".".$getExt[1];*/ $prod_img_thumb = $thumbdir.$getExt[0].".".$getExt[1]; move_uploaded_file($userfile_tmp, $prod_img); } /*$insert = mysqli_query($con,"INSERT INTO chat(`from`, `to`, `message`, `sent`) VALUES('','','$co','')"); $lastid = mysqli_insert_id($con);*/ include('class.uploader.php'); $uploader = new Uploader(); $data = $uploader->upload($_FILES['file'], array( 'limit' => 10, //Maximum Limit of files. {null, Number} 'maxSize' => 10, //Maximum Size of files {null, Number(in MB's)} 'extensions' => null, //Whitelist for file extension. {null, Array(ex: array('jpg', 'png'))} 'required' => false, //Minimum one file is required for upload {Boolean} 'uploadDir' => '../../../uploads/', //Upload directory {String} 'title' => array('name'), //New file name {null, String, Array} *please read documentation in README.md 'removeFiles' => true, //Enable file exclusion {Boolean(extra for jQuery.filer), String($_POST field name containing json data with file names)} 'replace' => false, //Replace the file if it already exists {Boolean} 'perms' => null, //Uploaded file permisions {null, Number} 'onCheck' => null, //A callback function name to be called by checking a file for errors (must return an array) | ($file) | Callback 'onError' => null, //A callback function name to be called if an error occured (must return an array) | ($errors, $file) | Callback 'onSuccess' => null, //A callback function name to be called if all files were successfully uploaded | ($files, $metas) | Callback 'onUpload' => null, //A callback function name to be called if all files were successfully uploaded (must return an array) | ($file) | Callback 'onComplete' => null, //A callback function name to be called when upload is complete | ($file) | Callback 'onRemove' => null //A callback function name to be called by removing files (must return an array) | ($removed_files) | Callback )); if($data['isComplete']){ $files = $data['data']; echo json_encode($_FILES['file']['name'][0]); } if($data['hasErrors']){ $errors = $data['errors']; echo json_encode($errors); } exit; ?>