Home  >  Article  >  Backend Development  >  php+Uploadify在win7下安装配置好了,也可以正常运行,但在linux下无法上传,该怎么解决

php+Uploadify在win7下安装配置好了,也可以正常运行,但在linux下无法上传,该怎么解决

WBOY
WBOYOriginal
2016-06-13 12:02:25933browse

php+Uploadify在win7下安装配置好了,也可以正常运行,但在linux下无法上传
PHP这里我用的是YII框架,应该没什么影响


/*
Uploadify 后台处理方法
*/
public function actionuploadify(){

//设置上传目录
$path = "./uplode/video/";
//这里$_FILES为空
if (!empty($_FILES)) {

//得到上传的临时文件流
$tempFile = $_FILES['Filedata']['tmp_name'];

//允许的文件后缀
$fileTypes = array('avi','rmvb','mpg','wav');

//得到文件原名
$fileName = iconv("UTF-8","GB2312",$_FILES["Filedata"]["name"]);
$fileParts = pathinfo($_FILES['Filedata']['name']);

//接受动态传值
$files=$_POST['typeCode'];

//最后保存服务器地址
if(!is_dir($path))
mkdir($path);


//判断singerInfo文件是否存在且不为空
$this->getSingFile();


if (move_uploaded_file($tempFile, $path.$fileName)){
$myfile = explode(".",$fileName);

$sql = $this->getfile($myfile[0],1);

if ($sql){

//songandSinger文档插入
$songSingerFile = "./uplode/image/songSinger.txt";
$this->getSongFile($myfile[0],$songSingerFile,"dSongAndSinger","kSingerID");

//songandType文档插入
$songTypeFile = "./uplode/image/songType.txt";
$this->getSongFile($myfile[0],$songTypeFile,"dSongAndType","kSongTypeID");

//songandStyle文档插入
$songStyleFile = "./uplode/image/songStyle.txt";
$this->getSongFile($myfile[0],$songStyleFile,"dSongAndStyle","kSongStyleID");

echo $fileName."文件上传成功,数据上传成功!";

}else{
echo $fileName."文件上传成功,数据上传失败!";
}
//

}else{
echo $fileName."上传失败!";
}

}

}

下面是html代码,上传a标签
上传

处理上传的js代码







------解决方案--------------------
$_FILES为空?
这是因为你的上传文件大于 php 设定的表单大小 post_max_size

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn