added text file attachment code