Back

Access file from function

  • 0
  • Functions
  • Cloud
whataboutno13
26 Sep, 2023, 14:19

Hi there, I wrote a function on <#1102936099745177700> on version 1.1.2 which sets up my database, creates the collections, attributes etc. This info is stored in a resources folder with multiple jsons containing the inforformation needed. I cannot see where this folder is deployed on the new 1.4 cloud version. Can anyone help me with some documentation I am missing or just the structure of the deployed functions so I can figure it out myself? πŸ˜…
Thank you for your help in advance! <:appwriteheart2:1073243188954935387>

TL;DR
User is asking for help with accessing a local file in a Dart function. They mention that Dart gets compiled, so the assets may not get added to the binary. They suggest loading the files from a bucket instead. Another user asks for clarification on the programming language being used. The user then explains that they wrote a function on an older version of Appwrite, which sets up a database and uses a resources folder with multiple JSON files. They can't find this folder in the new cloud version and are looking for documentation or information on the structure of deployed functions. They express gratitude for any help. Solution: One solution suggested is to load
Drake
27 Sep, 2023, 01:07

what language?

whataboutno13
27 Sep, 2023, 07:33

dart

whataboutno13
27 Sep, 2023, 08:08

2.17

Drake
27 Sep, 2023, 21:00

so because dart gets compiled, I don't think the assets get added to the binary that is eventually run. it might be best to put the file in a bucket or something

whataboutno13
28 Sep, 2023, 09:03

Alright I'll load the files from a bucket then

loks0n
28 Sep, 2023, 09:08

This function template should show you how to access a local file. It serves a local HTML file. https://github.com/appwrite/templates/tree/main/dart/censor_with_redact

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