PHP File Upload Example Tutorial _php tutorial

Source: Internet
Author: User
Tags html form php file upload
Okay, let's take a look at the simplest php file Upload Example tutorial, we'll use Move_uploaded_file to upload local articles to the server.

Okay, let's take a look at the simplest php file Upload Example tutorial, we'll use Move_uploaded_file to upload local articles to the server.

With PHP, you can upload files to the server.


-------------------------------------------------- ------------------------------

Create an upload file form
In order for users to upload files in the form can be very useful.

Take a look at the file upload for the following HTML form:

Please note the following HTML form above:

This is the Enctype property

The tags the specified content type when used in the form of submission. "Multiple/form of data" when using a form that requires binary data, such as the file content, will upload the
this type = "File" attribute specifies that the input of the tag should be the processing file. For example, when viewed in a browser, there will be a browse button next to the input field
Note: Allowing users to upload files is a great security risk. Only trusted users are allowed to upload files.


Create upload script
The code that is included in the "upload_file.php" file uploads the file:

Move_uploaded_file ($_files["File" ["Tmp_name"] A
"upload/". $_files["File" ["name"]);
echo "Stored in:". Upload/". $_files["File" ["name"];

The

is so simple.

http://www.bkjia.com/phpjc/630484.html www.bkjia.com true http://www.bkjia.com/phpjc/630484.html techarticle Well, let's take a look at the simplest php file Upload Example tutorial, we'll use Move_uploaded_file to upload local articles to the server. Okay, let's take a look at the simplest php text ...

  • 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.