How to effectively implement multi-video upload function in PHP

Source: Internet
Author: User

The advent of the video to make the site more colorful, for the PHP upload video, I need to implement multi-video upload, video playback function, mute function, full-screen playback, download video functions, such as one of the needs, next for everyone to explain in detail how to achieve a multi-video upload such a feature. The specific code is as follows:

<form method= "POST" name= "MyForm" action= "{: U (' Doeditvideo ')}" enctype= "Multipart/form-data" >

* Video:   
* upload video: /td>
    PHP Implementation code: Public Function Doeditvideo () {Header ("content-type:text/html;charset=utf-8");  $id =i ("id");  $data [' Addtime ']=time ();  if ($_files["video" ["Name"]!= ") {$arr 1= $this->upload1 ();  $imgstr 1 = "";  foreach ($arr 1 as $VV) {$imgstr 1.= $vv [' Savename '].  } $imgstr 1=trim ($imgstr 1, ', ');  $data [' Video ']= $imgstr 1;  }else{$data [' Video ']=0;  } $model =m (' Dynamic ');  if ($model->where ("id= $id")->save ($data)) {$this->success ("Success", U ("Dynamic/index"));  }else{$this->error ("Failed to publish");  }} Public Function Upload1 () {Import (' ORG.Net.UploadFile '); $upload = new UploadFile (); Instantiation of the Upload class $upload->maxsize = 9999999; Set attachment upload size $upload->allowexts = Array ("VOB", "Ifo", "mpg", "mpeg", "Dat", "mp4", "3gp", "mov", "rm", "Ram", "RMVB", "WMV"  , "ASF", "Avi", "ASX"); $upload->savepath = './public/uploads/video/';  Set attachments upload Directory $info = $upload->upload ();  $arr = $upload->getuploadfileinfo ();  return $arr; I believe you see here the program developers should already know how to implement it, then you can now start to try it, if there are other aspects of the question, you can leave a message to discuss, we receiveAfter the message will be the first time to give a detailed reply. This article by the Professional Zhengzhou app development company Brigitte Xuan Science and technology finishing release, if need reprint please indicate source.

How PHP effectively implements multi-video simultaneous uploads

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.