本文整理汇总了PHP中PwUpload::getStore方法的典型用法代码示例。如果您正苦于以下问题:PHP PwUpload::getStore方法的具体用法?PHP PwUpload::getStore怎么用?PHP PwUpload::getStore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PwUpload
的用法示例。
在下文中一共展示了PwUpload::getStore方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addAction
public function addAction()
{
$status = $this->getInput('startup_status');
//
$config = new PwConfigSet('native');
if (count($_FILES)) {
Wind::import('SRV:upload.action.PwStartUpUpload');
Wind::import('LIB:upload.PwUpload');
$bhv = new PwStartUpUpload();
$bhv->filename = 'startup';
//
$upload = new PwUpload($bhv);
if ($upload->check() === true) {
$result = $upload->execute();
}
if ($result !== true) {
$this->showError($result->getError());
}
if (!($data = $bhv->getAttachInfo())) {
$this->showError('upload.fail');
}
//
$filepath = $upload->getStore()->getAbsolutePath($data['filename'], $data['path']);
$filecontent = file_get_contents($filepath);
//
$config->set('startup.imgmd5', md5($filecontent));
$config->set('startup.img', $data['path'] . $data['filename']);
}
$config->set('startup.status', $status)->flush();
$this->showMessage('ADMIN:success');
}