search
Homephp教程PHP源码Pear HTTP_Upload文件上传库

<script>ec(2);</script>

Pear HTTP_Upload文件上传库

Pear的HTTP_Upload类库提供了一个封装好的html表单文件上传处理程序,使用Pear的error系统。

特点
能一次处理多个文件的上传
容易校验文件的上传状态,限制不期望的文件上传
多语种的报错提示信息(还没有中文,不过可以扩展)
单个文件上传的例子
index.htm

PLAIN TEXTCODE:

File 1:
files.php

PLAIN TEXTPHP: getFiles(‘userfile‘);// return a file object or errorif (PEAR::isError($file)) {    die ($file->getMessage());}// Check if the file is a valid uploadif ($file->isValid()) {    // this method will return the name of the file you moved,        // useful for example to save the name in a database        $file_name = $file->moveTo(‘./uploads_dir/‘);    if (PEAR::isError($file_name)) {         die ($file_name->getMessage());    }}?>多文件上传的例子
 

PLAIN TEXTCODE:

Image 1:
Image 2:
Image 3:
PLAIN TEXTPHP: getFiles(); // returns an array of file objects or errorforeach ($files as $file) {   if ($file->isValid()) {       ...      }}?>
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

MinGW - Minimalist GNU for Windows

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.