Back

[SOLVED] Access host filesystem from within a function

  • 1
  • Self Hosted
  • Functions
  • Storage
ilikechicken77
26 Jul, 2023, 09:29

Usually I add folders as volumes in docker-compose.yml.. since the open-runtimes functions are running in isolated containers, they are not part of the docker compose. The runtimes are just brought up when functions get executed.

How do I make folders/shares accessible for a function?

TL;DR
You can access the host filesystem from within a function by using the Appwrite 1.4 release. This update allows you to host multiple endpoints as a single function, giving you more flexibility and scalability. Additionally, you can upload data to Appwrite Storage before executing your function and retrieve the data within your function using the Appwrite Storage API. This will enable you to read and manipulate files as needed. Keep in mind that the open-runtimes functions run in isolated containers, so they are not part of the docker-compose.
joeyouss
26 Jul, 2023, 14:03

Hi there! you can use Appwrite's built-in data storage feature. Appwrite has a storage API https://appwrite.io/docs/client/storage that allows you to store, manage, and access files and data from within your functions

joeyouss
26 Jul, 2023, 14:06

Upload Data to Appwrite Storage: Before executing your function, you can upload the required data or files to the Appwrite storage. You can use the Appwrite Storage API to upload files from your local machine or another remote location directly to Appwrite.

Retrieve Data in Function: Inside your function, you can use the Appwrite Storage API to fetch the uploaded data. The data will be available as a file or binary, and you can read and manipulate it as needed within your function code.

joeyouss
26 Jul, 2023, 14:17

In Appwrite 1.4, we are committed to enhancing the functionality and scalability of functions. Our aim is to make functions more robust, both in terms of performance and code management.

One of the significant improvements will be the ability to host multiple endpoints as a single function where developers can potentially host the entire API with hundreds of endpoints as just one function in Appwrite 1.4.

so, this would really resolve your issue. Our release is coming up soon so I would definitely love for you to try it out soon!

ilikechicken77
27 Jul, 2023, 08:25

Ah ok now I get it.. Nice, Im really looking forward to 1.4 thx very much mate

ilikechicken77
27 Jul, 2023, 08:25

[Solved]Access host filesystem from within a function

ilikechicken77
27 Jul, 2023, 08:26

[SOLVED] Access host filesystem from within a function

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