本文整理匯總了PHP中IO::upload_by_content方法的典型用法代碼示例。如果您正苦於以下問題:PHP IO::upload_by_content方法的具體用法?PHP IO::upload_by_content怎麽用?PHP IO::upload_by_content使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類IO
的用法示例。
在下文中一共展示了IO::upload_by_content方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getBzByPath
$bz = getBzByPath($path);
switch ($type) {
case 'NewTxt':
$filename = '新建文本文檔.txt';
if (!perm_check::checkperm_Container($path, 'newtype', $bz)) {
exit(json_encode(array('error' => '沒有權限')));
}
break;
case 'NewDzzDoc':
$filename = '新建Dzz文檔.dzzdoc';
if (!perm_check::checkperm_Container($path, 'dzzdoc', $bz)) {
exit(json_encode(array('error' => '沒有權限')));
}
break;
}
if ($arr = IO::upload_by_content(' ', $path, $filename)) {
if ($arr['error']) {
} else {
$arr['msg'] = 'success';
}
} else {
$arr = array();
$arr['error'] = lang('template', '新建失敗');
}
echo json_encode($arr);
exit;
} elseif ($do == 'deleteIco') {
$arr = array();
$names = array();
$i = 0;
$icoids = $_GET['icoids'];
示例2: topshowmessage
}
}
if (!preg_match("/^(http|ftp|https|mms)\\:\\/\\/.{4,300}\$/i", $link)) {
topshowmessage('網址格式錯誤!');
}
$icoarr = io_dzz::linktourl($link, $pfid);
} elseif ($_GET['type'] == 'dzzdoc') {
$aid = empty($_GET['aid']) ? 0 : intval($_GET['aid']);
$attach = C::t('attachment')->fetch($aid);
if (!$attach) {
topshowmessage(lang('message', 'attachment_nonexistence'));
}
if (!empty($_GET['filename'])) {
$attach['filename'] = trim($_GET['filename']);
}
$icoarr = IO::upload_by_content(IO::getFileContent('attach::' . $attach['aid']), $pfid, trim($attach['filename'], '.dzzdoc') . '.dzzdoc');
} else {
$aid = empty($_GET['aid']) ? 0 : intval($_GET['aid']);
$attach = C::t('attachment')->fetch($aid);
if (!$attach) {
topshowmessage(lang('message', 'attachment_nonexistence'));
}
if (!empty($_GET['filename'])) {
$attach['filename'] = trim($_GET['filename']);
}
$icoarr = io_dzz::uploadToattachment($attach, $pfid);
}
if (isset($icoarr['error'])) {
topshowmessage($icoarr['error']);
}
include template('common/header_simple');