Home > php教程 > php手册 > body text

php编辑,上传,修改文件属性代码

WBOY
Release: 2016-06-13 11:22:31
Original
827 people have browsed it

php编辑,上传,修改文件属性代码
  m('文件上传 '.(@copy($_FILES['uploadfile']['tmp_name'],$uploaddir.'/'.$_FILES['uploadfile']['name']) ? '成功' : '失败'));
 }

 // 编辑文件
 elseif ($editfilename && $filecontent) {
  $fp = @fopen($editfilename,'w');
  m('保存文件 '.(@fwrite($fp,$filecontent) ? '成功' : '失败'));
  @fclose($fp);
 }

 // 编辑文件属性
 elseif ($pfile && $newperm) {
  if (!file_exists($pfile)) {
   m('原始文件不存在');
  } else {
   $newperm = base_convert($newperm,8,10);
   m('文件编辑 '.(@chmod($pfile,$newperm) ? '成功' : '失败'));
  }
 }


source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!