The defendant, or any person entitled to defend, upon presenting an affidavit showing a valid defense to the whole or some part of the plaintiff‘s claim, and upon paying into court such part thereof as the defendant admits, with costs and disbursements then incurred, may have the attachment dissolved by giving a bond, to be approved by the judge, conditioned for the payment of any sum that may be recovered in the action. At least five days’ notice shall be given of the application for such dissolution, and at the hearing thereof the judge may require the sureties to justify orally at such time and place as the judge may direct. The bond so approved, the affidavit and notice, and the order of dissolution shall be filed with the court administrator, whereupon the property shall be released.