Back

Fileupload event create fires up on chunks?

  • 0
  • Web
Camo
10 Feb, 2024, 21:47

buckets.bucketid.files.*.create Does the file upload event fire up on chunks??? My logic relies if the file is fully uploaded then do manipulations with it, but i see a ton of events fired up when its not even done.

TL;DR
Title: Fileupload event firing on chunks before completion Messages: Developers discussed checking if `chunksTotal` is equal to `chunksUploaded` to determine if the file upload is complete. They also mentioned that the payload of the event can be accessed in the event data. They recommended looking at the API response for more information. Some developers mentioned difficulties in debugging payloads and requested an example. Another developer suggested checking if it's the last chunk in the function. The original poster mentioned that the file upload event was firing on chunks before completion, particularly for larger files. Solution: It was suggested to check if the `chunksTotal` is equal to
Camo
10 Feb, 2024, 21:48

it works perfectly fine with smaller files, but i got 1mil email lists uploaded that are about 27mb in size..

Steven
10 Feb, 2024, 21:49

Yep. In the function you can check if it's the last chunk

Camo
10 Feb, 2024, 21:49

how would one do that?

Steven
10 Feb, 2024, 21:49

Look at the event data

Camo
10 Feb, 2024, 21:49

can you point me to an example if you know one ?

Steven
10 Feb, 2024, 21:50

The payload of the event is always in the event data. If you're creating an account, you get the user. If you're creating a document, you get the document. If you're creating a file, you get the file

Camo
10 Feb, 2024, 21:51

man i wish it was more easy to debug payloads here

Steven
10 Feb, 2024, 21:51
Camo
10 Feb, 2024, 21:53

const { $createdAt, $updatedAt, $permissions, signature, chunksTotal, chunksUploaded } = body;

Camo
10 Feb, 2024, 21:53

i guess we check if chunksTotal == chunksUploaded

Camo
10 Feb, 2024, 21:54

Thanks @Steven will look in to that

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