Home >php教程 >php手册 >一个另类的php文件上传的简单例子

一个另类的php文件上传的简单例子

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-13 11:37:04978browse

一个另类的php文件上传的简单例子


$data = file_get_contents(“D:\works\logo.png”); //原文件路徑
$ifp = fopen(“test.png”, “wb” ); //打開新文件,如果不存在則創建文件
fwrite( $ifp, $data); //将原文件的流写入到新的文件中
fclose( $ifp ); //關閉文件操作流
?>

这样做虽然简单,但是会覆盖源文件,而且我感觉有时候用文件函数会出现不可预料的事情~

本文地址:http://www.52blogger.com/archives/572 转载请保留

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