abstract: public function upload() { $file = Request::file('img'); $info = $file->validate(['size'=>2097152,'ext'=>'jpg,jpeg,png,gif'])->move('upload'); i
public function upload() { $file = Request::file('img'); $info = $file->validate(['size'=>2097152,'ext'=>'jpg,jpeg,png,gif'])->move('upload'); if($info){ return json(['errno'=>0,'data'=>['/upload/'.$info->getSaveName()]]); }else{ return $file->geterror(); } }
文本編輯如果 用戶不停上傳文件, 又沒有最后發(fā)布那upload里文件不停膨脹 有沒解決辦法 更好管理內(nèi)部圖片類文件。
Correcting teacher:查無此人Correction time:2019-01-11 11:40:57
Teacher's summary:有問題可以提交工單,或者在群里問。作業(yè)里問的,我回答你,你無法在追問。 管理圖片,可以創(chuàng)建個圖片庫,每次上傳的圖片,都放到數(shù)據(jù)庫里,做個后臺圖片管理頁面,一個月檢查一次,沒有引用的圖片,可以直接用功能刪除。