IPFS video upload - 400MB - size?

it looks like 100MB doesnā€™t work for me either now, I get timeout

it works fine with 100MB, I didnā€™t test it right initially

1 Like

with 300MB it looks like it doesnā€™t work, can you test directly from cloud code?

https://docs.moralis.io/moralis-server/cloud-code/cloud-functions#ipfs

Okay, Iā€™m not able to test right now, but I will and let you know. Tks so much. Anyway, Iā€™ll have to make sure what the limit really is, to avoid my users to get stucked uploadingā€¦

Letā€™s hope itā€™s just a server Chrismasā€™ break and wait for Ivan Santa Claus giftsā€¦

I tried to call the cloud function and give an url param like this:

const result = await Moralis.Cloud.toIpfs({

    sourceType: "url",

    source:

      "https://drive.google.com/file/d/1B-XBWdgIkXXjZ6fxjLxGHFCT6c80kb_z/view?usp=sharing",

  });

But I got:
TypeError: Moralis.Cloud.toIpfs is not a function

Otherwise, if I call: const result = await Moralis.Cloud.run(ā€œtoIpfsā€,{ params})
I get:
Error: Invalid function: ā€œtoIpfsā€

Am I missing anything?

Besides, what I would like to do is to allow the user to upload a local video (mp4) from his/her machine direct to IPFS. As there is not a sourceType related to this kind of format, what should I do? Do I have to encode the video before? Or upload to any other host and from there send by url?

you could convert it to base64 and then send it, but youā€™ll have to test it how it works with big sizes, or upload it to any other host and from there send by url

I tested now with this code and it works fine for me:


Moralis.Cloud.define("try_ipfs", async (request) => {
const result = await Moralis.Cloud.toIpfs({
  sourceType: "url",
  source: "https://moralis.io/wp-content/uploads/2021/06/Moralis-Glass-Favicon.svg",
});
return result;
})

@matt_dev, I tested meanwhile with an upgraded server and it worked fine with a 300MB file

Great!

The coudFunction worked, but google and dropbox seem to block the url for download.
I will try to upload somewhere else and try from there.

Did you make it from an url?

I did it directly from Moralis SDK with 300MB

uploading from your local machine?

yes, from my local machine, but I used an upgraded server when it worked with 300MB

which version did you use?

I used an equivalent of $200/month server with latest Moralis Server version

Okay!

Iā€™m still testing, so I am in the free plan yet. But it is nice to know it works in the paid ones. Do I need to go to a custom plan or the Pro version is eneough?

Pro version is something different than upgrading the servers, there are separate upgrades for servers so they have more processing power compared to the servers that are free.

I seeā€¦

Well, Iā€™ve made a lot of tests today and I was able to upload a 133MB file.

But then I test with 254MB and 330MB and for these I got this error:
Access to XMLHttpRequest at ā€˜https://biiflg28iijy.usemoralis.com:2053/server/files/video8.mp4ā€™ from origin ā€˜https://biiflg28iijy.usemoralis.comā€™ has been blocked by CORS policy: No ā€˜Access-Control-Allow-Originā€™ header is present on the requested resource.

and for 575MB and 923MB I got another one:
moralis.js:28263 Uncaught (in promise) Error: Invalid file upload.
at handleError (moralis.js:25632)

Itā€™s quite weird, because I tried all of the files from the same localhost server and also deployed a static version in 2 differents servers on Moralis infra.

For development purposes, 133MB is quite good, but I would really appreciate to know if the 1GB limit is working, even in paid plans. This is one video which Iā€™ve been test and has 923MB:

Would you mind to try it and let me know wheter it works?

We will have to decide where to host usersā€™ content and it would be great if Moralis handle everythingā€¦

Another thing that I noted is that, as the api handles the ajax request, I havenā€™t figured out a way of getting the upload progress. For these big files they could think in provide us a callback or any solution to get that progress.

what are you building that you need to upload files so big on IPFS?