Simple Image Upload using PHP

Source: Internet
Author: User

// Upload a file. Linux + Apache + php3/4 passed the test. IIS test failed, win + Apache + PhP not tested
<? PHP
If ($ http_post_vars ["Upload"] = "Upload "){
File: // here you can add functions such as checking the file name, format, and image size,
File: // $ picurl full path of the Local System
File: // $ temporary file name after picurl_name upload
File: // $ picurl_size file size (in bytes)
File: // $ MIME type of the picurl_type File

Copy ("$ picurl", "/where/you/want/Put/The/uploaded/files/In/$ picurl_name ");
Exit;
}
?>
<Form action = "." method = "Post" enctype = "multipart/form-Data" name = "Ul">
<! -- Note: 'enctype = "multipart/form-Data" 'must be added here; otherwise
Transmission -->
<Input type = "file" name = "picurl" size = "15"
Accept = "image/X-PNG, image/GIF, image/JPEG">
<Input type = "Submit" name = "Upload" value = "Upload">
</Form>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.