文件管理
文件ID | 文件名称 | 文件大小 | 上传时间 | 下载 | 删除 |
".$i++." | ".$row['f_name']." | ".number_format($size, 2, '.', '')."KB | ".$row['f_date']." | 下载 | 删除 |
unset($rs);
$db->close();
?>
uploadfile
if(!$_FILES["userfile"]["name"]) exit;
//echo $_FILES['userfile']['type'];
if ($_FILES['userfile']['error'] > 0)
{
echo 'Problem: ';
switch ($_FILES['userfile']['error'])
{
case 1: echo 'File exceeded upload_max_filesize'; break;
case 2: echo '不能超过800M'; break;
case 3: echo 'File only partially uploaded'; break;
case 4: echo 'No file uploaded'; break;
}
exit;
}
else
{ //检查上传文件是否在允许上传的类型
$tp = array("gif","jpeg","png","txt","doc","rar","zip","xls","bmp","wmv","mp3","flv","rmvb","avi");
if (!in_array(strtolower(substr(strrchr($_FILES['userfile']['name'], '.'),1)), $tp))
{
echo '文件类型错误,请重新选择文件!
只允许rar,zip,jpg,gif,txt,png,bmp,xls类型的文件';
exit;
}
$path="./file/"; //上传路径
if(file_exists($path.$_FILES['userfile']['name'])) //判断文件是否存在
{
echo '文件已存在,请更改后重新上传!';
exit;
}
if($_FILES["userfile"]["name"])
{
$file1=$_FILES["userfile"]["name"];
$file2 = $path.$file1;
$flag=1;
}
if($flag)
$result=move_uploaded_file($_FILES["userfile"]["tmp_name"],$file2);
//特别注意这里传递给move_uploaded_file的第一个参数为上传到服务器上的临时文件
if($result)
{
$time=date("Y-m-d");
// $url=$patch.$name;
$size=$_FILES["userfile"]["size"];
include("conn.php");
$rs=$db->query("insert into filem(f_name,f_url,f_date,f_size) values('$file1','$file2','$time','$size')");
// $rs=$db->query($sql);
echo "";
}
unset($rs);
$db->close();
}
?>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Atom editor mac version download
The most popular open source editor

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),