Skip to content

ndi.util.webSaveVerbose

 WEBSAVEVERBOSE Saves web content to a file and prints verbose debugging info.
    savename = webSaveVerbose(filename, url)
    savename = webSaveVerbose(filename, url, options)

    Acts as a drop-in replacement for MATLAB's built-in websave function,
    but adds detailed diagnostic output to help debug download issues.
    This function is compatible with all MATLAB versions and content types.

    It performs a 4-step process:
    1. Download & Header Capture: Uses webread, gracefully falling back to a
       content-only download if headers are not available for the content type.
    2. Hex Dump: Prints the first 1024 bytes of the content in hex format.
    3. Save to File: Manually saves the downloaded content to the specified file.
    4. Verification: Compares file size against Content-Length if available.

    Example:
        url = 'https://www.ndi-cloud.com/about';
        filename = 'about.html';
        webSaveVerbose(filename, url);

    See also websave, webread, weboptions.