2021-04-29

JavaScript - String to file

const string_here = "asdf";

const file = new File(

    [string_here],

    "file_name.xml",

    {type: "application/xml"}

);


PS. Then this can be treated as an input file to, for example, upload to an S3 bucket.

No comments:

Post a Comment