How to Convert Blob to File Using Javascript?
blob to file javascript
const file = new File(
blob,
'filename.png',
{
type: blob.type,
lastModified: new Date().getTime()
}
)
javascript blob to file
const file = new File(
[blob],
'filename.png',
{
type: blob.type,
lastModified: new Date().getTime()
}
)
A Blob() is just like a File() but with two differences, the lastModifiedDate and the name . The Blob() does not have lastModifiedDate and name . So, we have two options, either add these two properties to the blob or create an actual file's instance.