now i am try to make website for minting and trade NFT.
but now i can not use dedicated gateway.
This is the process to get the iPFS URL by sending the selected IMAGE to Infura.
but now it shows error becoz public infura doesn’t work .
I used public infura like this
//ipfs
const IPFS_URL = "https://ipfs.io/ipfs/";
const IPFS_API_URL = "ipfs.infura.io";
const ipfs = window.IpfsApi(IPFS_API_URL, "5001", { protocol: "https" }); // Connect to IPFS
$("#btn_uploadfile").on("click", function () {
if ($("#uploadfile").val() == "") {
alert("selcet image");
$("#uploadfile").focus();
return;
}
var reader = new FileReader();
reader.onloadend = function () {
//console.log("reader.result" + reader.result);
var buf = buffer.Buffer(reader.result); // Convert data into buffer
ipfs.files.add(buf, (err, result) => {
// Upload buffer to IPFS
if (err) {
console.error(err);
return;
}
var hash_img_url = IPFS_URL + result[0].hash;
//console.log(`Url --> ${hash_img_url}`);
$("#ipfs_file_url").text(hash_img_url);
$("#ipfs_file_url").attr("href", hash_img_url);
$("#hash_img_url").val(hash_img_url);
});
};
//console.log($('input#uploadfile')[0].files[0]);
reader.readAsArrayBuffer($("input#uploadfile")[0].files[0]); // Read Provided File
});
now public infura is not working so i made dedicated gateway like this
https://benjaminkor2.infura-ipfs.io
but i don’t know how it use and where should i put this.
Plz help me