【move_uploaded_file】【copy】区别

move_uploaded_file会事先检测源文件是否通过php上传过来的,否则不予移动;移动,即操作成功后原
文件没了,这个函数是基于安全考虑的,和文件大小没有关系(上传文件的大小主要受 php.ini 中 upload_max_filesize 的影响)
move_uploaded_file()不能文件与文件之间对传,而copy()就可以对传.比如说:if(move_uploaded_file($file[‘tmp_name’],$upload_da_dir)||(makethumb($upload_da_dir,$a,600,800,0,1))){
if(copy($upload_da_dir,$upload_xiao_dir)||(makethumb($upload_xiao_dir,$b,100,118,0,1))){//第二个就不能用move_uploaded_file()了 只能用copy(),or就不能达到功能

move_upload_file() when executed will move the file to the directory assigned in parameter, move_uploaded_file has some additional security checks to ensure that the file was actually uploaded.

copy(), the file will also be copied to the directory assigned in parameter, but the file being copied will not be removed from the temporary directory until the script has exited and PHP performs it destruction or shutdown process.

 

Leave a comment

BlueAsteroid

Just another WordPress.com site

Jing's Blog

Just another WordPress.com site

Start from here......

我的心情魔方

天才遠私廚

希望能做一個分享各種資訊的好地方

语义噪声

西瓜大丸子汤的博客

笑对人生,傲立寰宇

Just another WordPress.com site

Where On Earth Is Waldo?

A Project By Melanie Coles

The Serious Computer Vision Blog

A blog about computer vision, robotics, and artificial intelligence.

Cauthy's Blog

paper review...

Cornell Computer Vision Seminar Blog

Blog for CS 7670 - Special Topics in Computer Vision

datarazzi

Life through nerd-colored glasses

Luciana Haill

Brainwaves Augmenting Consciousness

槑烎

1,2,∞

Dr Paul Tennent

and the university of nottingham

turn off the lights, please

A bunch of random, thinned and stateless thoughts around the Web

John's Weblog

Just another WordPress.com weblog

I Am That I Am

Chasing tomorrow's sunrise.