addMempic.php public function addMempic($file, $path) { $id = md5(uniqid(microtime() . mt_rand())); $extensions = $file-getClientOriginalExtension(); $newname = $id . '.' . $extensions; $file-move($path, $newname); $lujing = '/'.$path.'/'.$
public function addMempic($file, $path) { $id = md5(uniqid(microtime() . mt_rand())); $extensions = $file->getClientOriginalExtension(); $newname = $id . '.' . $extensions; $file->move($path, $newname); $lujing = '/'.$path.'/'.$newname; $bak_url= str_replace(date("Ym"),'bak',$path); if (!file_exists($bak_url)) { mkdir($bak_url, 0777, true); } copy($path.'/'.$newname,$bak_url.'/'.$newname ); return $lujing; }