<! Doctype html public "-// w3c // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<Html xmlns = "http://www.111cn.net/1999/xhtml">
<Head>
<Meta http-equiv = "content-type" content = "text/html; charset = gb2312"/>
<Title> Untitled Document </title>
</Head>
<Body>
<? Php
// Php file Upload class (this class supports uploading of one or more files)
/**
* Class name: upfile
* Function: process file uploads.
* Description: This class processes Upload of one or more files. When using this class, you only need to list this class
* Example:
* $ Up = upfile ()
* $ Up-> update_file ($ _ file ['filename'])
*
* $ Up-> update_file function returns an array. Multi-dimensional data is returned if multiple files are uploaded.
* Array content:
* $ Fileinfo ['File _ size'] size of the uploaded file
* $ Fileinfo ['File _ suffix '] file Upload type
* $ Fileinfo ['File _ name'] name of the uploaded file
* $ Fileinfo ['error'] file upload error
*
*/
Class upfile {
Public $ fcount = 1; // Number of uploaded files
Public $ ftype = array ('jpg ', 'jpeg', 'GIF', 'PNG '); // File format
Public $ fsize = 1024; // File Size Unit: kb
Public $ fdir = 'www .111cn.net/'; // file storage directory
Public $ errormsg = ''; // generated temporary error message
/**
* Function name: get_tmp_file ($ putfile)
* Function: get the temporary file name for upload.
* @ Param array $ putfile
* @ Return string $ upimg returns the temporary file name
*/
Function get_tmp_file ($ putfile ){
If ($ this-> fcount = 1 ){
$ Tmpfile = $ putfile ['tmp _ name'];
} Else {
For ($ I = 0; $ I <$ this-> fcount; $ I ++ ){
$ Tmpfile [] = $ putfile ['tmp _ name'] [$ I];
}
}
Return $ tmpfile;
}