Home >Backend Development >PHP Tutorial >A simple example of an alternative PHP file upload_PHP tutorial

A simple example of an alternative PHP file upload_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 14:54:311035browse

A simple example of an alternative php file upload

$data = file_get_contents(“D:workslogo.png”); //Original file path
$ifp = fopen(“test.png”, “wb” ); //Open New file, if it does not exist, create the file
fwrite( $ifp, $data); //Write the stream of the original file to the new file
fclose( $ifp ); //Close the file operation stream
?>

Although this is simple, it will overwrite the source file, and I feel that sometimes unpredictable things will happen when using file functions~

This article address: http:/ /www.52blogger.com/archives/572 Please keep the reprint

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/364634.htmlTechArticleA simple example of an alternative PHP file upload? $data = file_get_contents(D:workslogo.png); // Original file path $ifp = fopen(test.png, wb); //Open a new file, create it if it does not exist...
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