首页
开发手册
应用中心
工具
用户中心
FoundPHP Large File Upload
English
中文简体
English
上一篇
下一篇
### FoundPHP Large File Upload Use the file submission form to upload smaller files. If you want to upload large files, you will have to wait a long time using this method. Here is a large file upload component that can monitor the upload progress. #### 1.Introduce Large File Upload Component FoundPHP provides a large file upload component, which introduces js and css into the interface of uploading files. **Example** ```html
``` #### 2.File Receiving Receive the file submitted by the form in PHP, the FoundPHP framework has automatically referenced the FoundPHP file upload class (*If you are not using the FoundPHP framework, you need to quote this class*) ```php $files_dir = dates(time(),'Ym').'/'.dates(time(),'d').'/'; //judgment file receipt if($_FILES['upload']['name']){ $files = $FoundPHP_upload->save(array( 'id' => 'upload', //submit file element name in the form 'maxsize' => '40000', //upload limit unit kb 'height' => '400', //height, only valid for pictures 'width' => '400', //width, only valid for pictures 'cut' => 1, //crop picture, choose one of zoom and zoom, only valid for picture 'zoom' => 1, //scaling the picture in proportion, choose one of cut and cut, only valid for picture 'lock' =>0, //0 width, width and height are not enough to fill the color, 1 zoom the maximum width of the photo, only valid for the image 'dir' => $FILE_DIR.$files_dir, //storage path 'name' => rand(1000,9999), //storage path 'type' => array('jpg','png','jpeg'), //supported format 'json' => 1 //output json format )); } ``` #### 3.Receive Return Parameter Data | field| description| |-----|-----| |id |elements of file submission| |ext|file format| |upfile|upload file name plus suffix| |upname|upload file name without suffix| |filesize|file size| |filename|save file name| |dir|file save path| |code|1 for upload success, 0 for upload failure|