The file form element should take care of this.