A simple PHP multi-image upload small script _php tutorial

Source: Internet
Author: User
I've written a lot of pictures uploaded before, but none of them are short. The simpler the program, the better, isn't it?

First on the source code, you can copy to your own computer up to run ~

 
              Multiple file uploads            
 
      

Move_uploaded_file () function

The Move_uploaded_file () function moves the uploaded file to a new location. Returns true if successful, otherwise false is returned.

Usage: move_uploaded_file (file,newloc)

    • Parameter file, required. Specifies the files to be moved.
    • Parameter newloc, required. Specify a new location for the document.

This function checks and ensures that files specified by file are valid upload files (that is, uploaded via PHP's HTTP POST upload mechanism). If the file is valid, move it to the file specified by Newloc.

If file is not legitimately uploaded, no action will occur and Move_uploaded_file () will return false.

If file is a legitimate upload, but for some reason it cannot be moved, nothing happens, Move_uploaded_file () returns false, and a warning is issued.

This check is especially important if the uploaded file is likely to cause the user or other users of the system to display its content.

Note: This function is only used for files uploaded via HTTP POST.

Note: If the destination file already exists, it will be overwritten.

http://www.bkjia.com/PHPjc/752577.html www.bkjia.com true http://www.bkjia.com/PHPjc/752577.html techarticle I've written a lot of pictures uploaded before, but none of them are short. The simpler the program, the better, isn't it? First on the source code, you can copy to your own computer to run ...

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