Back

Execute function on file upload

  • 0
  • Self Hosted
  • Functions
  • Storage
Jörn Hofmann
12 Oct, 2023, 13:06

I want to execute a function after a file is finished.

I know there is "buckets . * . files . * . create" event, but it fires on every uploaded chunk of the file.

I want to only execute it once after the file is finished uploading.

Currently I check in my function if chunksUploaded == chunksTotal

Is there a specific event that i dont know of?

TL;DR
The user wants to execute a function after a file is finished uploading. They have tried using the "buckets.*.files.*.create" event, but it fires on every uploaded chunk of the file. They are looking for a specific event that only triggers once the file is completely uploaded. There is no known solution mentioned in the thread. The user is advised to file an issue on Github.
darShan
12 Oct, 2023, 17:32

As per the docs, there's only a few events for Files : buckets.*.files.*.create/update/delete.

I haven't really tried the events with file uploaded in chunks but it doesn't sound right to me. Create should usually be fired on complete file upload.

Maybe file an issue on Github.

Drake
12 Oct, 2023, 18:28

Ya checking the chunks is the best option now

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