當前位置: 首頁>>代碼示例>>PHP>>正文


PHP file::downloadfile方法代碼示例

本文整理匯總了PHP中file::downloadfile方法的典型用法代碼示例。如果您正苦於以下問題:PHP file::downloadfile方法的具體用法?PHP file::downloadfile怎麽用?PHP file::downloadfile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在file的用法示例。


在下文中一共展示了file::downloadfile方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: dodownloadfile

 function dodownloadfile()
 {
     $filename = $this->get[2];
     $filename = str_replace('*', '.', $filename);
     $filedir = HDWIKI_ROOT . "/data/db_backup/" . $filename;
     file::downloadfile($filedir);
 }
開發者ID:meiwenhui,項目名稱:hdwiki,代碼行數:7,代碼來源:admin_db.php

示例2: dodownload

 function dodownload()
 {
     if (!isset($this->get[2]) || !is_numeric($this->get[2])) {
         $this->message($this->view->lang['parameterError'], 'BACK');
     }
     $result = $_ENV['attachment']->get_attachment('id', $this->get[2], 0);
     if (!(bool) ($attachment = $result[0])) {
         $this->message($this->view->lang['attachIsNotExist'], 'BACK');
     }
     if ($this->user['uid'] != $attachment['uid']) {
         // 判斷金幣
         $credit1 = $this->user['credit1'];
         // 擁有金幣數
         $coindown = $attachment['coindown'];
         // 下載此附件需要消耗金幣數
         if (0 > $credit1 - $coindown) {
             // 金幣不足
             $this->message($this->view->lang['goldNotEnough'], "index.php?doc-view-" . $attachment['did'], 0);
         }
         // 扣除金幣
         $_ENV['user']->add_credit($this->user['uid'], 'attachment-down', 0, -$coindown);
         // 增加金幣
         $_ENV['user']->add_credit($attachment['uid'], 'attachment-down', 0, $coindown);
     }
     $_ENV['attachment']->update_downloads($attachment['id']);
     file::downloadfile($attachment['attachment'], $attachment['filename']);
 }
開發者ID:meiwenhui,項目名稱:hdwiki,代碼行數:27,代碼來源:attachment.php

示例3: dodownload

 function dodownload()
 {
     if (!isset($this->get[2]) || !is_numeric($this->get[2])) {
         $this->message($this->view->lang['parameterError'], 'BACK');
     }
     $result = $_ENV['attachment']->get_attachment('id', $this->get[2], $this->get[3]);
     if (!(bool) ($attachment = $result[0])) {
         $this->message($this->view->lang['attachIsNotExist'], 'BACK');
     }
     $_ENV['attachment']->update_downloads($attachment['id']);
     file::downloadfile($attachment['attachment'], $attachment['filename']);
 }
開發者ID:meiwenhui,項目名稱:hdwiki,代碼行數:12,代碼來源:admin_attachment.php


注:本文中的file::downloadfile方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。