webmain/task/api/fileAction.php
(开头部分) 1KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
/**
* 文件下载相关接口-用于app
*/
class fileClassAction extends apiAction
{
/**
* 获取文件信息
*/
public function getfileAction()
{
$id = (int)$this->post('id',0);
$rs = m('file')->getone($id);
if(!$rs)$this->showreturn('', '文件不存在1', 201);
$path = $rs['filepath'];
if(isempt($path) || !file_exists($path))$this->showreturn('', '文件['.$rs['filename'].']不存在', 202);
$rs['filetype'] = m('file')->getmime($rs['fileext']);
$this->showreturn($rs);
}
/**
* 下载文件
*/
public function downAction()
{
$id = (int)$this->jm->gettoken('id');
m('file')->show($id);
}
/**
* 获取文件信息
*/
public function getfilenewAction()
{
$id = (int)$this->post('id',0);
$rs = m('file')->getone($id);
if(!$rs)$this->showreturn('', '文件不存在1', 201);
$path = $rs['filepath'];
if(isempt($rs['filenum'])){
if(substr($path,0,4)!='http' && !file_exists($path))
$this->showreturn('', '文件['.$rs['filename'].']不存了', 202);
}
$rs['filetype'] = m('file')->getmime($rs['fileext']);
$rs['downurl'] = '';
$this->showreturn($rs);
}
/**
* 生成水印图片
*/
public function shuiyinAction()
{
header("Content-type:image/png");
$font = 'upload/data/simsun.ttc';
if(!file_exists($font))$font = 'C:/Windows/Fonts/simsun.ttc';
$w = 110;
$im = imagecreatetruecolor($w,$w);
后面还有 14 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
