Uncaught (in promise) Error: missing input file(s) - Error while uploading the file using web3Storage

Hey everyone, I am getting an error while uploading the file. Any help!

async function fileEvent(){
       
        var fileInput = document.getElementById("input");
        const rootCid = await client.put(fileInput.files[0]);
        console.log(rootCid);
    
        const res = await client.get(rootCid);
        const files = await res.files();

        const url = URL.createObjectURL(files[0]);
        console.log(url)
        setFile(url)
    }

Thank you.

Sure,


<input className="file-input" onChange={fileEvent} type="file" id="input" /> I called a function here. Can you help me with this?

Closing this to move the discussion to Getting an error while adding file to web3Storage - #2 by danieln