本文整理汇总了PHP中PwUpload::copyFile方法的典型用法代码示例。如果您正苦于以下问题:PHP PwUpload::copyFile方法的具体用法?PHP PwUpload::copyFile怎么用?PHP PwUpload::copyFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PwUpload
的用法示例。
在下文中一共展示了PwUpload::copyFile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: defaultAvatar
public function defaultAvatar($uid, $type = 'face')
{
Wind::import('LIB:upload.PwUpload');
$_avatar = array('.jpg' => '_big.jpg', '_middle.jpg' => '_middle.jpg', '_small.jpg' => '_small.jpg');
$defaultBanDir = Wind::getRealDir('RES:') . 'images/face/';
$store = Wind::getComponent('storage');
$fileDir = 'avatar/' . Pw::getUserDir($uid) . '/';
foreach ($_avatar as $des => $org) {
$toPath = $store->getAbsolutePath($uid . $des, $fileDir);
$fromPath = $defaultBanDir . $type . $org;
PwUpload::createFolder(dirname($toPath));
PwUpload::copyFile($fromPath, $toPath);
$store->save($toPath, $fileDir . $uid . $des);
}
return true;
}
示例2: _defaultAvatar
private function _defaultAvatar($uid, $type = 'face')
{
Wind::import('LIB:upload.PwUpload');
$_avatar = array('.jpg' => '_big.jpg', '_middle.jpg' => '_middle.jpg', '_small.jpg' => '_small.jpg');
$defaultBanDir = Wind::getRealDir('ROOT:') . 'res/images/face/';
$fileDir = 'avatar/' . Pw::getUserDir($uid) . '/';
$attachPath = Wind::getRealDir('ROOT:') . 'windid/attachment/';
foreach ($_avatar as $des => $org) {
$toPath = $attachPath . $fileDir . $uid . $des;
$fromPath = $defaultBanDir . $type . $org;
PwUpload::createFolder(dirname($toPath));
PwUpload::copyFile($fromPath, $toPath);
}
return true;
}