Skip to content

Instantly share code, notes, and snippets.

@alcir-junior-caju
Last active January 9, 2024 19:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alcir-junior-caju/0e521c633a4e8ab360dd89f7a740ba17 to your computer and use it in GitHub Desktop.
Save alcir-junior-caju/0e521c633a4e8ab360dd89f7a740ba17 to your computer and use it in GitHub Desktop.
Download Image external Upload
fetch(url)
.then(response => response.blob())
.then(blob => {
const file = new File([blob], name, { type: 'image/*' });
dispatch({
type: 'SET_IMAGE',
payload: {
...data,
imageUrl: url,
image: file,
},
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment