function treat_postImage($files, $request) { try { $images = $files['fileURL']; $images = treatFiles($images, $request, IMAGE_PATH, IMAGE_PREFIX); $images = resizeImages($images, $request); $images = cropImages($images, $request); return json_encode((object) $images); } catch (Exception $e) { throw $e; } }
$picture_path = "../picture/{$admin_id}/" . $picturecat_id . "/" . $picture_id . "/"; mkdir_r($picture_path, 0777); $aaa = $_FILES['picture_file']; for ($i = 0; $i < count($_FILES['picture_file']); $i++) { mkdir_r($picture_path, 0777); if (is_file($_FILES['picture_file']['tmp_name'][$i])) { $picture_file[$i] = array('name' => $_FILES['picture_file']['name'][$i], 'type' => $_FILES['picture_file']['type'][$i], 'tmp_name' => $_FILES['picture_file']['tmp_name'][$i], 'error' => $_FILES['picture_file']['error'][$i], 'size' => $_FILES['picture_file']['size'][$i]); if ($picture_file[$i]['type'] == "application/pdf" && $picture_file[$i]['error'] == '0') { $now = date("YdmHis") . $i; $picture_pdf_path = $picture_path . "/pdf"; $pdf_file = $picture_pdf_path . "/" . $now . ".pdf"; if (!is_dir($picture_pdf_path)) { umask(0); mkdir_r($picture_pdf_path, 0777); } /*else{ umask (0); chmod_r($picture_pdf_path,0777); }*/ @move_uploaded_file($picture_file[$i]['tmp_name'], $pdf_file); } else { resizeImages($i, $picture_file[$i], 700, 700, 200, 200, $picture_path); } } } } } } else { header("Location:index.php?page=picture&picturecat_id=" . $picturecat_id . "&admin_id=" . $admin_id . ""); } header("Location:index.php?page=picture&picturecat_id=" . $picturecat_id . "&admin_id=" . $admin_id . "");
if(($product_file[$i]['type'] == "application/pdf") && ($product_file[$i]['error'] == '0')){ $now = date("YdmHis").$i; $product_pdf_path = $youtupe_path . "/pdf"; $pdf_file = $product_pdf_path ."/". $now . ".pdf"; if(!is_dir($product_pdf_path)){ umask (0); mkdir_r($product_pdf_path,0777); }/*else{ umask (0); chmod_r($product_pdf_path,0777); }*/ @move_uploaded_file($product_file[$i]['tmp_name'], $pdf_file); }else{ resizeImages($i,$product_file[$i],700,700,200,200,$youtupe_path); } } } } }else{ header("Location: index.php?page=vdo_system&select_page=youtube&id_cat_youtupe=".$id_cat_youtupe.""); } header("Location: index.php?page=vdo_system&select_page=youtube&id_cat_youtupe=".$id_cat_youtupe.""); ?>