Home >Backend Development >PHP Tutorial >Teach you how to simply upload images in PHP

Teach you how to simply upload images in PHP

WBOY
WBOYOriginal
2016-08-08 09:34:061101browse

//File Upload. The linux+apache+php3/4 test passed. The iis test failed, win+apache+php was not tested
if ($HTTP_POST_VARS["upload"]=="upload"){
file://Here you can add functions such as checking file name, format, image size, etc.
file://$picurl The full path of the local system
file://$picurl_name Temporary file name after upload
file://$picurl_size file size (bytes)
file://$picurl_type The MIME type of the file

copy("$picurl","/where/you/want/put/the/uploaded/files/in/$picurl_name");
exit;
}
?>



accept="image/x-png,image/gif,image/jpeg">

The above has introduced how to implement simple image upload in PHP, including the content of image upload. I hope it will be helpful to friends who are interested in PHP tutorials.

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