Add realpath for local in upload function.