Once you get your CID you should be able to access it via your Infura IPFS dedicated gateway in the following way:
https://your_dedicated_gateway_name.infura-ipfs.io/ipfs/CID
I am not very familiar with the ipfs-core package but it seems to me that when using it you are also running your own node and the propagation of the CID in the p2p network depends on the number of your peers.
Are you able to access your CID using the ipfs.io gateway? as you have defined your url const? If not, this might mean that the content is not yet propagated p2p.
Should you want to switch to the ipfs-http-client javascript library we have quite a few examples of using it in our Support Tips category. Below I will paste just a few:
Thanks for the quick reply!, yes ofcourse I was able to see that using ipfs.io/ipfs/CID⦠but after sometime, it was not showing the same.
My requirement is to push the file image from the server to IPFS, thatās the reason I was using ipfs-core. I attempted to use ipfs-http-client, but it was throwing 403 forbidden issue.
Any direction on how to overcome this would let me use the ipfs-http-client at server side.
You are welcome.
403 Forbidden response status code indicates that the server understands the request but refuses to authorize it.
What is the version of the ipfs-http-client you used? also can you share a snippet of the code used with ipfs-http-client, containing the way you defined your credentials and auth as well?
I authenticated like below⦠Same stuff works fine with āipfsā package, but not letting me view, but in the case of ipfs-http-client it shows origin error.
Do we have any sample repository to work with nodejs + ipfs?.. Kindly assist.
My suggestion is to upgrade to the latest version of ipfs-http-client (59.0.0) and try again one of the examples I shared in my last reply using nodejs and ipfs-http-client.
Regarding the ipfs-core package, at the moment I donāt have a working example of it being used with infura. Reading thru the documentation it seems that it is a lighter version of the ipfs client without the cli.
When using it a local ipfs node will start and thatās why when adding some content you receive a CID. The p2p propagation of that CID in the ipfs network depends on the number of peers your local node has, thatās why sometimes it is available and on the ipfs.io gateway and sometimes it is not.
I have tried using the same parameters when authenticating and creating the ipfs client, below, as I would do when using the ipfs-http-client in order to upload through an Infura node, but it seems that this info is neglected somehow by the ipfs-core package and the upload is done through the local node.