⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testuploader.php

📁 fdgf bgffsdb shgfh hg dfh gfjdjd jhd
💻 PHP
字号:
<html>
<body>
<?php
////////////////////////////////////////////////////////////////////////

require "Uploader.php";

////////////////////////////////////////////////////////////////////////
function dumpAssociativeArray($array) {
    $res = '';
    $header = false;
    if (is_array($array) && sizeof($array)) {
        $res .= "<table border=1>\n";
        foreach(@$array as $values) {
            if (!$header) {
                $res .= "<th>" . implode("</th><th>", array_keys($values)) . "</th>\n";
                $header = true;
            }
            $res .= "<tr>\n";
            foreach($values as $key => $value) {
                $res .= "<td>" . ($value != '' ? $value : "&nbsp;") . "</td>";
            }
            $res .= "</tr>\n";
        }
        $res .= "</table>\n";
    }
    return $res;
}

////////////////////////////////////////////////////////////////////////
// show debug information
echo nl2br(Uploader::debug()) . "<br>";

// only images
$allowedTypes = array("image/bmp","image/gif","image/pjpeg","image/jpeg","image/x-png");
$uploadPath = 'c:/temp';
$overwrite = true;

$up = new Uploader();
    if ($up->wasSubmitted()) {
    // files were submitted
    echo dumpAssociativeArray($up->uploadTo($uploadPath, $overwrite, $allowedTypes));
// display form
} else {
    echo $up->openForm(basename(__FILE__)). "\n";
    echo $up->fileField(). "<br>\n";
    echo $up->fileField(). "<br>\n";
    echo $up->closeForm();
    
}
// display error
echo "<br>\n" . nl2br($up->error);

////////////////////////////////////////////////////////////////////////

?>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -