Hi @Mr_Tai, you have mentioned on other blood posts that you have resolved the issue.
Could you confirm and also share the results( if possible) with the rest of the community members, please?
Hi @lovekosmas its been a while i did not touch a PC but i found a kinda “dirty” solution.
I mean if you still want to stay on a 100% browser js upload.
It comprises of 5 steps.
First include old 29 version of ipfs http client which comprise Buffer you will need for the authorization with the newest ipfs http client lib (currently 57)
then instantiate an old ipfs that will be used only for buffer
const ipfsOld = IpfsHttpClient(‘ipfs.infura.io’, 5001, {protocol: ‘https’})
then the idea is to initialize an authorization variable before a first form event listener
authorization = ‘Basic ’ + ipfsOld.Buffer.from(document.querySelector(’#projectId’).value.trim()+ ‘:’ + document.querySelector(’#projectSecret’).value.trim()).toString(‘base64’);
(the credentials are retrieve from a form and your site should obviously hosted over https)
to create the authorization headers you will inject in the second recent ipfs http lib.
you must include the most version of the lib after that part otherwise there are collision with ipfs object
then you can now do the (nodejs style) instantiation of the ipfs object that requires crendentials
const ipfs = window.IpfsHttpClient.create({ host: ‘ipfs.infura.io’, port: 5001, protocol: ‘https’, headers: {authorization} })
then the rest of your logic