Add size check in file copy