Update upload file function