webmain/task/runt/uptoxinhudocAction.php
(开头部分) 4KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
/**
* 文件同步上传到文件平台
* php task.php uptoxinhudoc,run -fileid=1
*/
class uptoxinhudocClassAction extends runtAction
{
public function initAction()
{
exit('此文件已经不需要');
}
/**
* 发送上传文件
*/
public function runAction()
{
$fileid = (int)$this->getparams('fileid','0'); //文件ID
if($fileid<=0)return 'error fileid';
$frs = m('file')->getone($fileid);
if(!$frs)return 'filers not found';
$filepath = $frs['filepath'];
if(substr($filepath, 0, 4)=='http')return 'filepath is httppath';
$msg = $this->sendpath($filepath, $frs);
if($msg)return $msg;
return 'success';
}
private function sendpath($filepath, $frs)
{
$path = ROOT_PATH.'/'.$filepath;
if(!file_exists($path))return 'filepath not exists';
$lx = 'file';
if(getconfig('xinhudoc_diskops'))$lx='path';
$url = $this->upfileurl($lx);
//文件远程上传的
if($lx=='file'){
$data = base64_encode(file_get_contents($path));
$params = array(
'filename' => $frs['filename'],
'optname' => $frs['optname'],
'adddt' => $frs['adddt'],
'fileext' => $frs['fileext'],
'filesize' => $frs['filesize'],
'filepath' => $frs['filepath'],
'table' => ''.DB_BASE.'.file',
'mid' => $frs['id'],
'optid' => $frs['optid'],
);
$canstr = $this->jm->base64encode(json_encode($params));
$url .= '&sendtype=file¶msstr='.$canstr.'';
$result = c('curl')->postcurl($url, $data);
$msg = $this->chuliresult($result, $frs, 1);
if(!$msg){
后面还有 114 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
