PHP batch upload image example tutorial

Source: Internet
Author: User
Batch upload of images. the code used in the 9th Street album function can be used to upload images in batches at one time. The following is an example. if you do not understand the implementation process, leave a message to me and check with each other.

Batch upload of images. the code used in the 9th Street album function can be used to upload images in batches at one time. The following is an example. if you do not understand the implementation process, leave a message to me, you can discuss with each other...

 
 
  1. Upload picture more once
  2. If ($ _ POST ['upload'] = 'send '){
  3. $ Dest_folder = "picture /";
  4. If (! File_exists ($ dest_folder )){
  5. Mkdir ($ dest_folder );
  6. }
  7. Foreach ($ _ FILES ["pictures"] ["error"] as $ key => $ error ){
  8. If ($ error = UPLOAD_ERR_ OK ){
  9. $ Tmp_name = $ _ FILES ["pictures"] ["tmp_name"] [$ key];
  10. $ Name = $ _ FILES ["pictures"] ["name"] [$ key];
  11. $ Uploadfile = $ dest_folder. $ name;
  12. Move_uploaded_file ($ tmp_name, $ uploadfile );
  13. }
  14. }
  15. }
  16. ?>

The above code is all PHP programming for uploading images in batches, and I hope to help anyone who needs 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.