Is it possible to upload text files (e.g. JSON) to wordpress blog in any way? [closed]

function upload_file($file_url) {
    if ( ! filter_var($file_url, FILTER_VALIDATE_URL) ) return false;
    $get = wp_remote_get( $file_url );
    if ( ! is_wp_error(  $get ) ) {
      // check mime type if you want
      // $mime_type = wp_remote_retrieve_header( $get, 'content-type' );     
      return wp_upload_bits( basename($file_url), '', wp_remote_retrieve_body( $get ) );
    }
    return false;
}

// use it like
upload_file('http://www.site.com/path/myfile.json');

For what is returned see wp_upload_bits in codex.