本文整理匯總了PHP中UploadFile::uploadFile方法的典型用法代碼示例。如果您正苦於以下問題:PHP UploadFile::uploadFile方法的具體用法?PHP UploadFile::uploadFile怎麽用?PHP UploadFile::uploadFile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UploadFile
的用法示例。
在下文中一共展示了UploadFile::uploadFile方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: current
<?php
require_once 'header.php';
require_once 'classes.php';
require_once 'uploadFile.php';
$redirect_page = 'upload_dropdown2.php';
if (isset($_POST['ImageCategory']) && isset($_FILES['imagePost'])) {
if (!empty($_POST['ImageCategory']) && !empty($_FILES['imagePost'])) {
$file = current($_FILES);
$catID = current($_POST);
echo "<br>";
$upload = new UploadFile($catID, $file);
echo "<br>";
if ($upload->uploadFile($file)) {
$redirect_page .= "?upload=true";
} else {
$redirect_page .= "?upload=false";
}
header('Location: ' . $redirect_page);
}
} else {
$redirect_page = 'upload_dropdown2.php?upload=false';
header('Location: ' . $redirect_page);
exit;
}
$imageCategory = isset($_POST['ImageCategory']) && !empty($_POST['ImageCategory']) ? $_POST['ImageCategory'] : null;
$imagePost = isset($_FILES['imagePost']) && !empty($_FILES['imagePost']) ? $_FILES['imagePost'] : null;
if ($imageCategory && $imagePost) {
// We have BOTH a category and a file
die('uploaded file');
} else {