Use an actor to upload the file and avoid race conditions