prepare file