PHP file upload code

Source: Internet
Author: User
Tags php file upload

PHP file upload code is a very instance PHP file upload code program, it can be used.

<! Doctype html public "-// w3c // dtd xhtml 1.0 transitional // en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<Html xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Meta http-equiv = "content-type" content = "text/html; charset = gb2312"/>
<Title> php tutorial file upload code </title>
</Head>

<Body>

<Form method = "post" enctype = "multipart/form-data" action = "uploads. php">
<Input type = "file" name = "uploadedfile" size = "30">
<Input type = "hidden" name = "max_file_size" value = "100000">
<Input type = "submit" value = "Upload File">
</Form>

</Body>
</Html>

<? Php

If ($ uploadedfile <> "none "){
If (! Copy ($ uploadedfile, "$ uploadedfile_name ")){
Echo "<font face = 'arial' size = '2'> $ name File Upload Failed, <br> ";
Echo "or the file is too large <br> ";
Echo "Please use the back button to try again ";
} Else {
Echo "<font face = 'arial' size = '2'> the file is uploaded successfully! <Br> ";
Echo "file type: $ uploadedfile_type <br> ";
Echo "file size: $ uploadedfile_size <br> ";
Echo "File Name: $ uploadedfile_name <br> ";
Echo "file description: $ description <br> ";
}
}
/*
This is a very instance PHP file upload code program that can be used with it.
*/

?>


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.