1 Star 0 Fork 0

岳小威子 / space

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
upload.php 596 Bytes
一键复制 编辑 原始数据 按行查看 历史
alan.yue 提交于 2021-03-23 21:37 . test
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2021-3-21
* Time: 12:10
*/
$file = $_FILES['file'];//得到传输的数据
$type = $_GET['type'];
$upload_path = "file" . '/' . $type . '/' . date('Ym');
is_dir($upload_path) || mkdir($upload_path, 0777, true);
chmod($upload_path, 0777);
$name = $file['name'];
$rs = move_uploaded_file($file['tmp_name'], $upload_path . '/' . $file['name']);
if ($rs) {
echo json_encode(['code' => 10001, 'msg' => 'success:上传成功']);
} else {
echo json_encode(['code' => 10000, 'msg' => 'error:上传失败']);
}
?>
PHP
1
https://gitee.com/alan-yuewei/space.git
git@gitee.com:alan-yuewei/space.git
alan-yuewei
space
space
master

搜索帮助