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
Post a Comment