Provides a simple and practical php image file upload Instance code
PHP Tutorial picture File Upload Instance code
PHP Tutorial picture File Upload Instance code
if ($_post)
{
if ($_files[' file '])
{
$filename = $_files[' file ' [' type '];
$newname = ' php100.com.gif ';
if (Strtolower ($filename) = = ' Image/gif ')
{
if (move_uploaded_file ($_files[' file ' [' Tmp_name '], $newname))
{
$ext = getimagesize ($newname);
Print_r ($ext);
Echo ' image upload succeeded ';
}
Else
{
Die (' picture upload failed! ');
}
}
Else
{
Exit (' This program only allows GIF images to be uploaded ');
}
}
}
/*
Move_uploaded_file Syntax Reference address
Http://www.bkjia.com/phper/24/da78cda75379943ff126f6af13cf5aa9.htm
Strtolower instance Address
Http://www.bkjia.com/phper/21/805cd7d41d20a10b71b35e1a8f2b8596.htm
$_files said there was
$_files[' myfile ' [' Name '] The original name of the client file.
The MIME type of the $_files[' myfile ' [' type '] file requires the browser to provide support for that information, such as "Image/gif".
$_files[' myfile ' [' size '] the size of the uploaded file, in bytes.
$_files[' myfile ' [' tmp_name '] file is uploaded and stored on the server after the temporary file name, usually the system default. Can be specified in the php.ini upload_tmp_dir, but the putenv () function setting is not working.
$_files[' myfile ' [' Error '] and the file upload related error code. [' ERROR '] was added in PHP 4.2. Version 0
*/
?>
This site original tutorial reproduced annotated source in http://www.bkjia.com/phper/php.html
http://www.bkjia.com/PHPjc/444913.html www.bkjia.com true http://www.bkjia.com/PHPjc/444913.html techarticle provide a simple and practical php image File Upload Instance code php tutorial picture File Upload Instance code HTML xmlns=http://www.bkjia.com/1999/xhtml head meta http-equiv= Content-type Con ...