How can I upload blob data to vault in javascript?

I have a blob from the clipboard. Basically It is an image. I put the blob data in an img tag.

So I wanna upload the blob data to the vault and use it as an Image property.

Is there any idea to upload blob to vault in javascript?

  • Thank you. I solved the problem thanks to you.

    I made a html component in form like below.

    When copy and paste an image from clipboard, it will be uploaded in vault.

    and the uploaded file will be Item's image property. 


            <img src="" id="pastedImage">




                document.onpaste = function(event) {

                    var items = event.clipboardData.items;

                    console.log(JSON.stringify(items)); // will give you the mime types

                    var blob = items[0].getAsFile();

                    var reader = new FileReader();

                    reader.onload = function(event) {


                        document.querySelector('#pastedImage').src =;

                        var file = new File([blob],'test.png',{type:"image/png"});

                        var newFile = aras.newFileItem(file);

                        var fileId = newFile.getAttribute("id");

                        var fileItem = aras.IomInnovator.newItem();


                        fileItem = fileItem.apply();


                    }; // data url