php - Is it better to use fwrite() or move_uploaded_file()? -


it's more of coding standards question one. 1 is, if can call "better" use in file upload handler scripts?

i know fwrite() , it's accompanying methods reading , writing can in chunks using move_uploaded_file() more elegant , shorter code.

thanks

use move_uploaded_file(). checks ensure user not funny business. also, using fread() , fwrite() copies file, instead of moving it, few orders of magnitude more costly moving (which changes it's name, given source , destination on same partition).


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -