ipfs-image-web-upload

1.0.5 • Public • Published

ipfs-image-web-upload

Simple uploader/downloader for images stored on ipfs.

Allows to upload pictures from html <input type='file' ...> and use them in <img src='...'> tag.

Usage

To upload image from file input:

<input type='file' id='someFileInputId'>
var uploader = new IPFSUploader(new IPFS());
var file_input = document.getElementById("someFileInputId");
var hash = await uploader.uploadBlob(e.target.files[0]);

To set image to html img element:

<img id='output'>
var img_tag = document.querySelector( "#output" );
uploader.loadImage(img_tag, hash);

Package Sidebar

Install

npm i ipfs-image-web-upload

Weekly Downloads

8

Version

1.0.5

License

MIT

Last publish

Collaborators

  • marekkirejczyk