本文整理汇总了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);
}
示例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']);
}
示例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']);
}