Rashid
Rashid

Reputation: 1740

How can I convert a data object to a file?

I have an Object that has same structure of data of a File Object

{
    lastModified: 1587700504077
    lastModifiedDate: Fri Apr 24 2020 11:55:04 GMT+0800 (Philippine Standard Time)
    name: "37-373238_black-sticker-black-flower-transparent-aesthetic-hd-png.png"
    size: 227226
    type: "image/png"
}

I want this data to be converted into File Object. Is there a way to do this?

Upvotes: 0

Views: 86

Answers (1)

Quentin
Quentin

Reputation: 943185

You can't convert that object to a file (at least, not to a file that represents a PNG image with a size of 227226 bytes of useful data). It contains a lot of metadata about a file, but none of the content of that file.

Upvotes: 2

Related Questions