function get_file($f3) { $hash_id = $f3->get("PARAMS.hash_id"); $id = Base56::decode($hash_id); $file = PFH_File_model::get($id); $filename = $file->filename; $filetype = $file->filetype; $md5 = $file->md5; //$filepath = PFH_MD5::get_file_path($f3, $md5); //$filepath = PFH_ZIP::read($f3, $md5); //$filepath = PFH_MD5::get_file_path($f3, $md5); $filepath = PFH_Archive::read($f3, $md5, $filename); $action = "download"; PFH_Log_model::create_log($f3, $file, $action); $force_download = FALSE; PFH_File_helper::download_contents($filepath, $filetype, $filename, $force_download); }
/** * 取得檔案 * @param String $id * @return RedBean */ static function get_by_hash_id($id) { $id = Base56::decode($id); $bean = R::load('file', $id); return $bean; }