add auto encode for `send_file` and `send_data`