IPFS video upload - 400MB - size?

VM6:1 POST https://adhpw3nnfjad.usemoralis.com:2053/server/files/video8.mp4 400
(anonymous) @ VM6:1
dispatch @ moralis.js:25496
ajax @ moralis.js:25503
(anonymous) @ moralis.js:25610
Promise.then (async)
request @ moralis.js:25604
saveBase64 @ moralis.js:13394
(anonymous) @ moralis.js:13348
tryCatch @ moralis.js:41120
invoke @ moralis.js:41351
(anonymous) @ moralis.js:41176
asyncGeneratorStep @ moralis.js:28195
_next @ moralis.js:28217
Promise.then (async)
asyncGeneratorStep @ moralis.js:28205
_next @ moralis.js:28217
(anonymous) @ moralis.js:28224
Wrapper @ moralis.js:32713
(anonymous) @ moralis.js:28213
(anonymous) @ moralis.js:13362
value @ moralis.js:12975
value @ moralis.js:13027
enviar @ Login.vue?013f:48
conectar @ Login.vue?013f:31
await in conectar (async)
onClick._cache.._cache. @ Login.vue?013f:4
callWithErrorHandling @ runtime-core.esm-bundler.js?9e79:6737
callWithAsyncErrorHandling @ runtime-core.esm-bundler.js?9e79:6746
invoker @ runtime-dom.esm-bundler.js?8886:357
moralis.js:28263 Uncaught (in promise) Error: Invalid file upload.
at handleError (moralis.js:25632)

Iā€™ve just updated to version 0.0.314, but still getting this

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?