Skip to content

Binary data restore when opening an image url #19

@XiaoFaye

Description

@XiaoFaye

Sample code:

var config = Configuration.Default.WithDefaultLoader().WithCookies();
var context = BrowsingContext.New(config);
await context.OpenAsync("http://www.xxx.com/");
var doc = await context.OpenAsync("http://www.xxx.com/abc.jpg");          
var data = doc.Body.TextContent;

When debug into the code, I can see the binary data of the image has been converted to UTF-8 string in doc.Boday.TextContent. That means the image has been downloaded. However I can't restore the image binary data with the UTF-8 string as some data has lost during the conversion.

Is there a way that I can get the original binary data of the image? For some reason, I can't download the image using regular way.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions