def _fetch_remote_file(service_url, params=None, use_http_post=False):
    """Retrieves a file from a URL.

    Returns a tuple (mimetype, filename, data)
    """
    if not params:
        params = {}

    request_url, response = _fetch_remote(service_url, params, use_http_post)
    dummy, params = cgi.parse_header(
            response.headers.get('Content-Disposition', ''))
    fn = params['filename']

    return (response.headers.get('content-type'),
            fn, response.read(), response.geturl())
Retrieves a file from a URL.

    Returns a tuple (mimetype, filename, data)