convert keys+values to bytes when sent with file data