SVG ToolsLesson 186Free preview
SVG Blob Generator
This lesson is part of Web Developer Tools · All levels
Summary
SVG Blob Generator packs the SVG code into a Blob object of the image/svg+xml type, and then creates a temporary URL with createObjectURL. The URL can be used to preview in an img tag, downloaded via a download attribute, or opened in a new tab. Once you're done, call revokeObjectURL to keep the memory from being wasted.
Key points
- Blobs store binary data or text in the browser
- The MIME type should be image/svg+xml
- URL.createObjectURL makes the URL temporarily blob:
- RevokeObjectURL releases the memory used by the blob
- The download attribute triggers the download of the file
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.