本文整理汇总了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 {