Cors error when getting video url from ipfs after uploading

Hi @cryptokid
I have one error using moralis.

After uploading video on ipfs using moralis, when getting the video from ipfs url, it occurs strange CORS error.

As you can see above screenshots, video link has correct prefix:
You can see my video from this full url:

I think It worked well yesterday.
But, today, it doesn’t work.

I don’t know the reason why it occurs CORS error now.

Hope your quick help.

Best regards,

You can try access it from instead of http://localhost:3000

Still same error.
And then, it doesn’t work on server too.

The thing what I think strangely is not error for images.
Only, it occurs cors error for video file.

What way are you trying to use the video ??

try to change the prefix to use

I am using the url for video NFT.
User uploads video for his nft on ipfs using moralis and save metadata with the url, and then can see his video uploaded from ipfs url on metadata.

you can get a CORS error also when the url gives a timeout or the server doesn’t respond

this seems to work for me:


You can consider checking the way the video is shown to the user too. It worked fine for me too passing the link to a video src tag

@qudusayo @cryptokid
Sure, I am using video tag for it.

{ nft.item_type && nft.item_type == 'video' &&
  <video width="100%" height="100%" controls className="lazy img-fluid">
      <source src={nft.image} type={nft.mime_type} />

you can try to replace the ipfs prefix with any other public IPFS prefix like from or cloudflare

There is not the correct solution?

I think whether it is because of moralis cache problem for video.
it is working for image:

it is not working for video:

What about hardcoding the video url ??

Because I have to confirm/get the mime type(video, image, audio) from the ipfs url, I was using @tokenizer/http node module.
Till yesterday, it did work very well.
But, a few hours ago, it doesn’t work with cors error.
I am not sure the reason.

The issue seemed coming from the way you’re trying to get the mime type. Was able to get the mime-type in such way

let target =
const req = await fetch(target);
const mimeType = await req.headers.get("content-type");

Also changed the prefix as @cryptokid mentioned


@qudusayo @cryptokid
I have the same issue.
I uploaded image file via moralis into ipfs.
When I get the image from “” it says Cors ERROR.
but, to fetch from gateway does work.

And then, for ipfs hash “QmQVj3gXiiGNJnwhFXxrYBxXW2Z4X5fbBFVC2yvHo3jPTX”,
gateway url doens’t work, but, does work.

So, which public url should I use?
I am not sure why it doesn’t work.

Can you explain in details?


How are you using fetch on image url?

I tried this with url and it is able to get the url data.

let target =
const req = await fetch(target);
const mimeType = await req.headers.get("content-type");

It does work above code with”.

But, it doesn’t work above code with
(it occurs cors error)

So, I am not sure which public gateway url should I use?

Do you understand my issue?

Thank you.

Can you try with public gateway or with cloudflare public gateway?