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