本文整理汇总了PHP中PwUpload::upload方法的典型用法代码示例。如果您正苦于以下问题:PHP PwUpload::upload方法的具体用法?PHP PwUpload::upload怎么用?PHP PwUpload::upload使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PwUpload
的用法示例。
在下文中一共展示了PwUpload::upload方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _uploadCsv
/**
* 上传csv文件到服务器端
*
*/
function _uploadCsv()
{
L::loadClass('csvupload', 'upload', false);
$csvupload = new CsvUpload($this->_uid);
PwUpload::upload($csvupload);
$this->_filename = $csvupload->pathname;
}
示例2: exit
<?php
!defined('P_W') && exit('Forbidden');
if (empty($_GET['step'])) {
define('AJAX', 1);
list($db_upload, $db_imglen, $db_imgwidth, $db_imgsize) = explode("\t", $db_upload);
S::gp(array('uid', 'verify'));
$swfhash = GetVerify($uid);
checkVerify('swfhash');
L::loadClass('faceupload', 'upload', false);
$face = new FaceUpload($uid);
PwUpload::upload($face);
$uploaddb = $face->getAttachs();
echo 'success';
//ajax_footer();
//echo $db_bbsurl . '/' . $attachpath . '/' . $uploaddb['fileuploadurl'] . '?' . $timestamp;
//exit();
} else {
L::loadClass('upload', '', false);
$ext = strtolower(substr(strrchr($_GET['filename'], '.'), 1));
$udir = str_pad(substr($winduid, -2), 2, '0', STR_PAD_LEFT);
//$source = PwUpload::savePath(0, "{$winduid}_tmp.$ext", "upload/$udir/");
if (!in_array(strtolower($ext), array('gif', 'jpg', 'jpeg', 'png', 'bmp'))) {
Showmsg('undefined_action');
}
/*if (!file_exists($source)) {
Showmsg('头像保存失败,图片大小请不要超过2M!');
}*/
$data = $_SERVER['HTTP_RAW_POST_DATA'] ? $_SERVER['HTTP_RAW_POST_DATA'] : file_get_contents('php://input');
if ($data) {
S::gp(array('from'));
示例3: stopicUploadImg
function stopicUploadImg($k)
{
global $db_bbsurl;
$img = new StopicUpload($k);
$returnImg = PwUpload::upload($img);
if (!is_array($returnImg) || count($returnImg) == 0) {
return false;
}
$imageUrl = geturl($returnImg[0]['fileuploadurl']);
return $imageUrl[0];
}
示例4: exit
!defined('P_W') && exit('Forbidden');
define('AJAX', 1);
S::gp(array('type'));
reset($_FILES);
$filekey = key($_FILES);
$aid = substr($filekey, strpos($filekey, '_') + 1);
if (!$aid) {
echo 'fail';
ajax_footer();
}
$modifyattach = getAttModifyFactory($type, $aid);
if (($return = $modifyattach->check()) !== true) {
showExtraMsg($return);
}
PwUpload::upload($modifyattach);
echo "ok\t" . $modifyattach->getAttachName();
ajax_footer();
function getAttModifyFactory($type, $aid)
{
if ($type == 'active') {
L::loadClass('activeupload', 'upload', false);
return new ActiveModify($aid);
}
if ($type == 'cms') {
require_once R_P . 'mode/cms/lib/upload/articleupload.class.php';
return new ArticleModify($aid);
}
if ($type && file_exists(R_P . "require/extents/attach/{$type}modify.class.php")) {
$class = $type . 'Modify';
require_once S::escapePath(R_P . "require/extents/attach/{$type}modify.class.php");
示例5: pwSqlSingle
} else {
$db->update("INSERT INTO pw_cnalbum SET " . pwSqlSingle(array('aname' => getLangInfo('app', 'defaultalbum'), 'atype' => 0, 'ownerid' => $winduid, 'owner' => $windid, 'lasttime' => $timestamp, 'crtime' => $timestamp)));
$aid = $db->insert_id();
}
}
!$aid && Showmsg('colony_albumclass');
$rt = $db->get_one("SELECT aname,photonum,ownerid,private,lastphoto FROM pw_cnalbum WHERE atype='0' AND aid=" . pwEscape($aid));
if (empty($rt)) {
Showmsg('undefined_action');
} elseif ($winduid != $rt['ownerid']) {
Showmsg('colony_phototype');
}
$o_maxphotonum && $rt['photonum'] >= $o_maxphotonum && Showmsg('colony_photofull');
require_once R_P . 'lib/upload/photoupload.class.php';
$img = new PhotoUpload($aid);
PwUpload::upload($img);
pwFtpClose($ftp);
if (!($photos = $img->getAttachs())) {
refreshto("{$basename}a=upload", 'colony_uploadnull');
}
$photoNum = count($photos);
$pid = $img->getNewID();
$lastpid = getLastPid($aid, 4);
array_unshift($lastpid, $pid);
if (!$rt['private']) {
$feedText = "[url={$db_bbsurl}/{$basename}space=1&a=album&aid={$aid}&u={$winduid}]{$rt[aname]}[/url]\n";
foreach ($photos as $value) {
$feedText .= "[url={$db_bbsurl}/{#APPS_BASEURL#}q=photos&space=1&a=view&pid={$pid}&u={$winduid}][img]" . getphotourl($value['path'], $value['ifthumb']) . "[/img][/url] ";
}
pwAddFeed($winduid, 'photo', $pid, array('num' => $photoNum, 'text' => $feedText));
//会员资讯缓存
示例6: array
/*
if ($privacy && is_array($privacy)) {
$pwSQL = array();
foreach ($privacy as $key => $value) {
if (in_array($key, $spaceModel)) {
$pwSQL[] = array(
'uid' => $winduid,
'type' => 'space',
'key' => $key,
'value' => $value
);
}
}
$pwSQL && $db->update("replace INTO pw_privacy (uid, ptype, pkey, value) values " . S::sqlMulti($pwSQL));
}
if ($domain != $space['domain'] && $db->get_value("SELECT COUNT(*) AS sum FROM pw_space WHERE domain=" . S::sqlEscape($domain))) {
Showmsg('该域名已被使用!');
}
*/
$pwSQL = array('name' => $name, 'descript' => $descript, 'domain' => $domain, 'spacestyle' => $spacestyle, 'spacetype' => $spacetype, 'skin' => $spaceskin, 'modelset' => serialize($modelset));
$layout && ($pwSQL['layout'] = serialize($layout));
set_time_limit(0);
require_once R_P . 'u/lib/spacebannerupload.class.php';
$upload = new spaceBannerUpload($winduid);
PwUpload::upload($upload);
if ($img = $upload->getImgUrl()) {
$pwSQL['banner'] = $img;
}
$newSpace->updateInfo($pwSQL);
refreshto('u.php?a=set', 'operate_success');
}
示例7: setAttach
/**
* 设置附件
* @param array $oldatt_desc
* @param array $keep
*/
function setAttach($flashatt, $oldatt_desc = array())
{
global $db_allowupload, $_G;
$attachs = $this->attach ? $this->attach : array();
$attachs = $this->_cookOldAttachs($attachs, $oldatt_desc);
C::loadClass('articleupload', 'upload', false);
$uploaddb = array();
if ($db_allowupload && $_G['allowupload'] && (PwUpload::getUploadNum() || $flashatt)) {
$articleUpload = new ArticleUpload();
$articleUpload->setFlashAtt($flashatt, intval($_POST['savetoalbum']), intval($_POST['albumid']));
PwUpload::upload($articleUpload);
$uploaddb = $articleUpload->getAttachs();
}
$this->attach = (array) $attachs + (array) $uploaddb;
}
示例8: insertData
function insertData($tid, $fid)
{
/*操作数据库*/
$this->data['tid'] = $tid;
$this->data['fid'] = $fid;
$topicdb = unserialize($this->data['topic']);
unset($this->data['topic']);
foreach ($topicdb as $key => $value) {
$this->data['field' . $key] = $value;
}
$tablename = GetTopcitable($this->modelid);
$this->db->pw_update("SELECT tid FROM {$tablename} WHERE tid=" . S::sqlEscape($tid), "UPDATE {$tablename} SET " . S::sqlSingle($this->data) . "WHERE tid=" . S::sqlEscape($tid), "INSERT INTO {$tablename} SET " . S::sqlSingle($this->data));
/*附件上传*/
require_once R_P . 'require/functions.php';
L::loadClass('pcupload', 'upload', false);
$img = new PcUpload($tid, $this->modelid);
PwUpload::upload($img);
pwFtpClose($GLOBALS['ftp']);
}
示例9: insertData
/**
* 操作数据库
* @param int $tid 帖子id
* @param int $fid 版块id
*/
function insertData($tid, $fid)
{
/*操作数据库*/
global $action, $atc_title;
$this->data['default'] = $this->data['act']['0'];
$this->data['default']['tid'] = $tid;
$this->data['default']['fid'] = $fid;
$this->data['default']['actmid'] = $this->actmid;
$this->data['user'] = array();
!S::isArray($this->data['act']['1']) && ($this->data['act']['1'] = array());
foreach ($this->data['act']['1'] as $key => $value) {
if ($value) {
$this->data['user'][$key] = $value;
}
}
$this->data['user']['tid'] = $tid;
$this->data['user']['fid'] = $fid;
unset($this->data['act']);
$defaultValueTableName = getActivityValueTableNameByActmid();
$userDefinedValueTableName = getActivityValueTableNameByActmid($this->actmid, 1, 1);
$this->db->pw_update("SELECT tid FROM {$defaultValueTableName} WHERE tid=" . S::sqlEscape($tid), "UPDATE {$defaultValueTableName} SET " . S::sqlSingle($this->data['default']) . "WHERE tid=" . S::sqlEscape($tid), "INSERT INTO {$defaultValueTableName} SET " . S::sqlSingle($this->data['default']));
$this->db->pw_update("SELECT tid FROM {$userDefinedValueTableName} WHERE tid=" . S::sqlEscape($tid), "UPDATE {$userDefinedValueTableName} SET " . S::sqlSingle($this->data['user']) . "WHERE tid=" . S::sqlEscape($tid), "INSERT INTO {$userDefinedValueTableName} SET " . S::sqlSingle($this->data['user']));
$subject = $this->db->get_value('SELECT subject FROM pw_threads WHERE tid=' . S::sqlEscape($tid));
if ($subject) {
$this->db->update('UPDATE pw_activitypaylog SET subject=' . S::sqlEscape($subject) . ' WHERE tid=' . S::sqlEscape($tid));
}
/*选择支付宝+没有绑定支付宝+没有通过支付宝实名认证 or 创建AA活动号*/
if ($this->data['default']['paymethod'] == 1) {
$tradeinfo = $this->db->get_one("SELECT tradeinfo FROM pw_memberinfo WHERE uid=" . S::sqlEscape($this->winduid));
$tradeinfo = unserialize($tradeinfo['tradeinfo']);
$alipay = $tradeinfo['alipay'];
$isBinded = $tradeinfo['isbinded'];
$isCertified = $tradeinfo['iscertified'];
if (!$alipay || $isBinded != 'T' || $isCertified != 'T') {
//选择支付宝+没有绑定支付宝+没有通过支付宝实名认证
$this->db->update("UPDATE {$defaultValueTableName} SET iscertified=0 WHERE tid=" . S::sqlEscape($tid));
} elseif ($alipay && $isBinded == 'T' && $isCertified == 'T') {
//绑定支付宝+通过支付宝实名认证
$this->db->update("UPDATE {$defaultValueTableName} SET iscertified=1 WHERE tid=" . S::sqlEscape($tid));
require_once R_P . 'lib/activity/alipay_push.php';
$alipayPush = new AlipayPush();
if ($action == 'new') {
$alipayPush->create_aa_payment($tid, $this->winduid, $this->actmid, $atc_title);
//创建AA活动号
} elseif ($action == 'modify') {
$alipayPush->modify_aa_payment($tid, $this->actmid, $atc_title);
//修改AA活动号
}
}
}
/*选择支付宝+没有绑定支付宝+没有通过支付宝实名认证 or 创建AA活动号*/
/*附件上传*/
L::loadClass('activityupload', 'upload', false);
$img = new ActivityUpload($tid, $this->actmid);
PwUpload::upload($img);
require_once R_P . 'require/functions.php';
pwFtpClose($GLOBALS['ftp']);
}
示例10: postThread
function postThread($uid, $fid, $subject, $content)
{
global $winddb, $winduid, $windid, $groupid, $_G, $timestamp, $pwforum, $pwpost, $uploadcredit, $uploadmoney, $db_uploadfiletype, $_time;
$timestamp = time();
$_time = array('hours' => get_date($timestamp, 'G'), 'day' => get_date($timestamp, 'j'), 'week' => get_date($timestamp, 'w'));
list($uid, $fid, $subject, $content) = array(intval($uid), intval($fid), trim($subject), trim($content));
if ($uid < 1 || $fid < 1 || !$subject || !$content) {
return $this->buildResponse(THREAD_INVALID_PARAMS);
}
ACloud_Sys_Core_Common::setGlobal('customized_current_uid', $uid);
$user = $this->getCurrentUser();
if (!$user->isLogin()) {
return $this->buildResponse(USER_NOT_LOGIN);
}
if ($user->groupid == 6 || getstatus($user->info['userstatus'], PW_USERSTATUS_BANUSER)) {
return $this->buildResponse(THREAD_USER_NOT_RIGHT);
}
$user->initRight();
$winduid = $user->uid;
$groupid = $user->groupid;
$windid = $user->username;
$winddb = $user->info;
$_G = $user->_G;
if ($_G['postlimit'] && $winddb['todaypost'] >= $_G['postlimit']) {
return $this->buildResponse(POST_GP_LIMIT);
}
L::loadClass('forum', 'forum', false);
$pwforum = new PwForum($fid);
if (!$pwforum->isForum()) {
return $this->buildResponse(THREAD_FORUM_NOT_EXIST);
}
list($uploadcredit, $uploadmoney, , ) = explode("\t", $pwforum->forumset['uploadset']);
L::loadClass('post', 'forum', false);
require_once ACLOUD_VERSION_PATH . '/customized/ver.customized.bbscode.php';
$pwpost = new PwPost($pwforum);
$pwpost->errMode = true;
$pwpost->forumcheck();
$pwpost->postcheck();
L::loadClass('topicpost', 'forum', false);
$topicpost = new topicPost($pwpost);
$topicpost->check();
$postdata = new topicPostData($pwpost);
$postdata->setWtype('', '', $pwforum->foruminfo['t_type'], $pwforum->foruminfo['topictype']);
$postdata->setTitle($subject);
$postdata->setContent($content);
$postdata->setConvert(1, 1);
$postdata->setTags('');
$postdata->setDigest('');
$postdata->setTopped('');
$postdata->setIfsign(1, 0);
if ($pwpost->errMsg && ($msg = reset($pwpost->errMsg))) {
return $this->buildResponse(THREAD_SYSTEM_ERROR, $msg);
}
require_once ACLOUD_VERSION_PATH . '/customized/ver.customized.attupload.php';
if (PwUpload::getUploadNum()) {
$_G['uploadtype'] && ($db_uploadfiletype = $_G['uploadtype']);
$db_uploadfiletype = !empty($db_uploadfiletype) ? is_array($db_uploadfiletype) ? $db_uploadfiletype : unserialize($db_uploadfiletype) : array();
$postdata->att = new AttUpload($user->uid);
$return = $postdata->att->check();
if ($return) {
$msginfo = getLangInfo('msg', $return);
return $this->buildResponse(THREAD_USER_NOT_RIGHT);
}
list($windVersion) = explode(',', WIND_VERSION);
if ($windVersion && $windVersion < '8.5') {
PwUpload::upload($postdata->att);
$postdata->att->transfer();
}
}
$topicpost->execute($postdata);
$tid = $topicpost->getNewId();
return $this->buildResponse(0, array('tid' => $tid));
}
示例11: elseif
if (array_key_exists('replace_' . $key, $_FILES)) {
$db_attachnum++;
$replacedb[$key] = $oldattach[$key];
} elseif ($value['desc'] != $v['desc']) {
$runsql[] = 'UPDATE pw_attachs SET ' . S::sqlSingle(array('needrvrc' => $v['needrvrc'], 'descrip' => $v['desc'], 'special' => $v['special'], 'ctype' => $v['ctype'])) . ' WHERE aid=' . S::sqlEscape($key);
}
}
}
$aids = $attachs = array();
L::loadClass('diaryupload', 'upload', false);
if (PwUpload::getUploadNum() || $flashatt) {
S::gp(array('savetoalbum', 'albumid'), 'P', 2);
$diaryUpload = new DiaryUpload($winduid, $flashatt, $savetoalbum, $albumid);
$diaryUpload->check();
$diaryUpload->setReplaceAtt($replacedb);
PwUpload::upload($diaryUpload);
$aids = $diaryUpload->getAids();
$attachs = $diaryUpload->getAttachs();
$attachIds = $diaryUpload->getAttachIds();
$ifupload = $diaryUpload->ifupload;
if ($oldattach && $diaryUpload->replacedb) {
foreach ($diaryUpload->replacedb as $key => $value) {
$oldattach[$key] = $value;
}
}
}
if ($attachs) {
foreach ($attachs as $key => $value) {
$oldattach[$key] = $value;
}
$userService = L::loadClass('UserService', 'user');
示例12: exit
<?php
!function_exists('readover') && exit('Forbidden');
if (empty($_GET['step'])) {
list($db_upload, $db_imglen, $db_imgwidth, $db_imgsize) = explode("\t", $db_upload);
S::gp(array('uid', 'verify'));
$swfhash = GetVerify($uid);
checkVerify('swfhash');
$db_uploadfiletype = array();
$db_uploadfiletype['gif'] = $db_uploadfiletype['jpg'] = $db_uploadfiletype['bmp'] = $db_uploadfiletype['png'] = $db_imgsize;
L::loadClass('upload', '', false);
$pwupload = new PwUpload(new FaceUpload());
$pwupload->upload($uid);
$uploaddb = $pwupload->getAttachs();
echo $db_bbsurl . '/' . $attachpath . '/' . $uploaddb['fileuploadurl'] . '?' . $timestamp;
exit;
} else {
require_once R_P . 'require/functions.php';
L::loadClass('upload', '', false);
$ext = strtolower(substr(strrchr($_GET['filename'], '.'), 1));
$udir = str_pad(substr($winduid, -2), 2, '0', STR_PAD_LEFT);
$source = PwUpload::savePath($db_ifftp, "{$winduid}_tmp.{$ext}", "upload/{$udir}/");
if (!file_exists($source)) {
Showmsg('undefined_action');
}
$data = $_SERVER['HTTP_RAW_POST_DATA'] ? $_SERVER['HTTP_RAW_POST_DATA'] : file_get_contents('php://input');
if ($data) {
require_once R_P . 'require/showimg.php';
$filename = "{$winduid}.jpg";
$normalDir = "upload/{$udir}/";
$middleDir = "upload/middle/{$udir}/";
示例13: elseif
}
} elseif ($check_step == 'certificate') {
//证件认证
$step = S::getGP('step');
$authService = L::loadClass('Authentication', 'user');
if (empty($step)) {
$certificateTypesHtml = $authService->getCertificateTypeHtml();
} elseif ($step == 2) {
S::gp(array('certificate'));
L::loadClass('certificateupload', 'upload', false);
!$certificate['number'] && Showmsg("请输入证件编号");
//删除原有认证
$certificateInfo = $authService->getCertificateInfoByUid($winduid);
$certificateInfo && $authService->deleteCertificateById($certificateInfo['id']);
$certificateUploadBehavior = new CertificateUpload($winduid);
PwUpload::upload($certificateUploadBehavior);
$certificateInfo = $authService->getCertificateInfoByUid($winduid);
$data = array('type' => $certificate['type'], 'number' => $certificate['number'], 'createtime' => $timestamp, 'state' => 1);
if (!S::isArray($certificateInfo) || !$certificateInfo['attach1'] && !$certificateInfo['attach2']) {
/*
$data['uid'] = $winduid;
$authService->addCertificateInfo($data);
*/
Showmsg("请上传至少一张证件图片再提交");
} else {
$authService->updateCertificateInfo($data, $certificateInfo['id']);
}
refreshto("profile.php?action=auth", '提交成功,请等待管理员审核');
}
}
require_once uTemplate::PrintEot('profile_auth');
示例14: messageMutiUpload
$mutiupload = new messageMutiUpload($uid);
} elseif ($type == 'cms') {
require_once R_P . 'mode/cms/lib/upload/articleupload.class.php';
$mutiupload = new articleMutiUpload($uid);
} elseif ($type && file_exists(R_P . "require/extents/attach/{$type}mutiupload.class.php")) {
$class = $type . 'MutiUpload';
require_once S::escapePath(R_P . "require/extents/attach/{$type}mutiupload.class.php");
$mutiupload = new $class($uid);
} else {
L::loadClass('attmutiupload', 'upload', false);
$mutiupload = new AttMutiUpload($uid, intval($_POST['fid']));
}
if (($return = $mutiupload->check()) !== true) {
showExtraMsg($return);
}
PwUpload::upload($mutiupload);
$attachInfo = $mutiupload->getAttachInfo();
if ($ua && $attachInfo) {
$attachService = L::loadClass('attachs', 'forum');
if ($attachInfo['path']) {
$tmp = $db_ifftp ? $db_ftpweb : $attachpath;
strpos($attachInfo['path'], "{$tmp}/") === 0 && ($tmpPath = substr($attachInfo['path'], strlen("{$tmp}/")));
strpos($tmpPath, "thumb/") === 0 && ($tmpPath = substr($tmpPath, 6));
$tmpPath && ($attachInfo['path'] = $attachService->getThreadAttachMini($tmpPath));
$attachInfo['attachurl'] = $tmpPath ? $tmpPath : $attachInfo['path'];
}
}
echo pwJsonEncode($attachInfo);
ajax_footer();
}
function showExtraMsg($msg)
示例15: insertData
function insertData($tid, $fid)
{
/*操作数据库*/
global $timestamp;
$this->data['tid'] = $tid;
$this->data['fid'] = $fid;
$pcdb = unserialize($this->data['postcate']);
unset($this->data['postcate']);
foreach ($pcdb as $key => $value) {
$this->data[$key] = $value;
}
$pcvaluetable = GetPcatetable($this->pcid);
$this->db->pw_update("SELECT tid FROM {$pcvaluetable} WHERE tid=" . S::sqlEscape($tid), "UPDATE {$pcvaluetable} SET " . S::sqlSingle($this->data) . "WHERE tid=" . S::sqlEscape($tid), "INSERT INTO {$pcvaluetable} SET " . S::sqlSingle($this->data));
/*附件上传-淡定*/
require_once R_P . 'require/functions.php';
L::loadClass('pcupload', 'upload', false);
$img = new PcUpload($tid, $this->pcid);
PwUpload::upload($img);
pwFtpClose($GLOBALS['ftp']);
}