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

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 11:37:04
Original
980 people have browsed it

一个另类的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 转载请保留

Related labels:
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
Latest Issues
Why does it still jump after returning false?
From 1970-01-01 08:00:00
0
0
0
Optimize table indexes in MySQL
From 1970-01-01 08:00:00
0
0
0
Why can't I install it?
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template