Home >php教程 >php手册 >php编辑,上传,修改文件属性代码

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-13 11:22:31944browse

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) ? '成功' : '失败'));
  }
 }


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
Previous article:php 防注入代码Next article:php 重命名与复制文件