Skip to content

Example of how to write binary download to disk ? #15

@Rockvole

Description

@Rockvole

Hi,
I am trying to download a zipfile and store the resulting zip file to disk.

Options options= new Options(
    responseType: ResponseType.STREAM
);
Dio dio = new Dio(options);
Response response=await dio.get(url);
File file = new File(outputDirectory+ filename);
await file.writeAsBytes(response.data);

writeAsBytes doesnt seem to return.

Do you have an example of how to do this ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions