控制器类代码 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Upload extends CI_Controller { public function index() { $this->load->view('up'); } function up(){ if(!empty($_POST['sub'])){ $file=$_FILES['upfile']; if($fil…
之前也做过文件上传,现在学了tp,用tp怎么做呢? 第一步:做一个Wenjian控制器: <?php namespace Ceshi\Controller; use Think\Controller; class WenjianController extends Controller { public function shangchuan(){ $this->show(); } public function wjsc(){ $upload = new \Think\Upload(); /…