本文整理汇总了PHP中Reports::uploader方法的典型用法代码示例。如果您正苦于以下问题:PHP Reports::uploader方法的具体用法?PHP Reports::uploader怎么用?PHP Reports::uploader使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reports
的用法示例。
在下文中一共展示了Reports::uploader方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Reports
<?php
require_once "../config.inc.php";
session_start();
print_r($_REQUEST);
print_r($_FILES);
$db = Database::obtain(DB_SERVER, DB_USER, DB_PASS, DB_DATABASE);
$db->connect();
$mode = $_REQUEST['mode'];
if ($mode === "reports") {
$file = $_FILES['file']['name'];
$temp_file = $_FILES['file']['tmp_name'];
$uid = $_REQUEST['uid'];
$upload_dir = '/reports/';
$r = new Reports('member', BASE_DOMAIN);
$upload_file = $r->uploader($file, $temp_file, $upload_dir);
$update = $r->updateReportField($uid, $file, 'file_info');
} elseif ($mode === "users") {
$file = $_FILES['file']['name'];
$temp_file = $_FILES['file']['tmp_name'];
$uid = $_REQUEST['uid'];
$upload_dir = '/avatars/';
$u = new Users('member', BASE_DOMAIN);
$upload_file = $u->uploader($file, $temp_file, $upload_dir);
$update = $u->updateUserField($uid, $file, 'avatar');
} elseif ($mode === "projects") {
$uid = $_REQUEST['uid'];
if (!empty($_FILES['vertical_img']['name'])) {
$vertical_file = $_FILES['vertical_img']['name'];
$vertical_temp_file = $_FILES['vertical_img']['tmp_name'];
} else {