Creating attachment from data and filename