Use move_uploaded_file() . He does additional checks to ensure that the user is not in any funny business. In addition, using fread() and fwrite() copy the file, rather than moving it , is several orders of magnitude more expensive than just moving it (which basically just changes its name , given that the source and destination are in the same section).
Felix source share