Back

Need help uploading video files

  • 0
  • Web
  • Storage
bolar pear
28 Aug, 2024, 20:12

Whenever I try to upload videos to my storage, I get an error saying my origin has been blocked by CORS policy and it fails to upload my video. This occurs exactly at one minute of upload time so I'm thinking it has to do with how long the upload is taking/how big the file size is. My max upload size set on my bucket is 5 GB and the mp4 files I'm trying to upload are around 50 mb. My uploading works fine when upload pictures, so I believe it has something to do with the file size of the mp4 files. I read that with larger file sizes, I need to break the file down into chunks in order for it to upload properly, but supposedly the SDK already does this for you so I'm not sure how to fix this. Here is my code for uploading a file (it is very basic):

export async function uploadFile(file: File) { try { const uploadedFile = await storage.createFile( appWriteConfig.storageId, ID.unique(), file ); return uploadedFile; } catch (error) { console.log(error); } }

TL;DR
Developers are experiencing CORS policy error while uploading video files. The error occurs exactly at one-minute mark, possibly due to file size. Max upload size is set to 5 GB with files around 50 MB. Uploading pictures works fine. Check if SDK handles chunking for larger files. Solution: Implement chunking manually for larger files during upload process.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more