This extension replaces selected file name with its file content either in plain or BASE64 encoded form.
After selecting file name, open context menu (right-click) and select "Replace File Name with File Content" or its variants.
The following image illustrates a very easy way to create data:
URL from a PNG image file:
The extension equips many of "Replace File Name with" commands. To use them, open command palette (Ctrl-Shift-P
or ⌘-Shift-P
) and type the command name manually.
The command replaces the selected file name with the file's content, assuming the content is UTF-8 encoded.
The command replaces the selected file name with the file's content encoded in BASE64.
The command replaces the selected file name with the data encoded with RFC 2397 The "data" URL scheme.
Although it is just a combination of BASE64 and Mime-type, it is very useful when embedding file data on HTML or CSS.
The command replaces the selected file name with the SHA-256 hash of the file.
The command replaces the selected file name with the SHA-1 hash of the file.
The command replaces the selected file name with the MD5 hash of the file.
The command replaces the selected file name (relative to the editing file's path) with its absolute path.
The command replaces the selected file name (absolute path) with its relative path to the editing file's path.
The command replaces the selected file name with its MIME type. The MIME type is guessing based on the extension of the file. No file content is checked by the extension.
https://github.com/espresso3389/insert-file
https://marketplace.visualstudio.com/items?itemName=espresso3389.insert-file