Since the storage system of each client is different, the saving is done in the backend instead of in the appwrite function
What's client platforms do you have? What backend are you referring to?
These are management applications made in vue3 in the frontend part and Typescript in the backend part.
Clients have a billing application and the appwrite function is responsible for collecting the invoice data and creating the pdf document
So you're using nuxt with a server side backend?
What's calling the function? The browser or the server side back end?
Yes, i dont use nuxt only vue but its the same.
I call the function in the server side
so if your function puts it in storage, your server can use storage.getFileView() to get the file buffer
Yes, I understand the procedure. Store the file and facilitate access to download it via appwrite storage.
The question to increase the response size was to have a temporary solution since the file system will take some time to implement it in several clients.
Thanks for your time and help @Steven I apreciate your job and dedication to this awesome plattform 🙂
what file system???? There is no file system involved in what i am suggesting
I'm sorry, maybe I didn't explain well
What I mean is that it will take me some time to change the implementation on the server side since there are several clients.
Instead of capturing a buffer in the return of the function, now it should capture something lighter like the url of the file to be able to download it previously on the server side.
it will take time to make any sort of change to the server side code?
Yes
For the moment I have managed to solve the problem temporarily, reducing the size of the pdf before returning it.
because the change should be something like:
const execution = functions.createExecution('[FUNCTION_ID]');
const buffer = execution.response;
to:
const execution functions.createExecution('[FUNCTION_ID]');
const fileId = execution.response;
const buffer = storage.getFileView('[BUCKET_ID]', fileId);
Would there be a simple way to programmatically delete the files after x time?
create an Appwrite Function that runs on a schedule to find and delete files
great
anyways...changing the limit can be complex because it's limited to 1MB in the database: https://github.com/appwrite/appwrite/blob/96fa7362f3f045c242758b7e42469e982a3039bf/app/config/collections.php#L2691-L2701
and the data from the runtime is trimmed: https://github.com/appwrite/appwrite/blob/96fa7362f3f045c242758b7e42469e982a3039bf/app/executor.php#L578-L580
that's why using storage is a much better alternative
Yes, I noticed that when trying to parse the response JSON it indicated that it was not valid. I saw that feature on github where you guys talked about: https://github.com/appwrite/appwrite/issues/3434
The change is simple but since I have it implemented in several projects I will need to take some time to test it in development and then upload it to production.
But we agree that the file system is the best option.
makes sense. thanks for the insight 👍🏼
Thanks 4 all @Steven
Recommended threads
- Scheduled works locking the entire Maria...
I have a scheduled function and apparently that or something is locking the entire MariaDB database and Appwrite is giving MariaDB errors. This error persists e...
- Python Function not working
I am getting this issue as well. Doesnt look like there was a solution as you guys were not able to replicate. Below is my code as well as the error. I started...
- I can't share code between functions
Operating System: MacOS Appwrite Version: self-hosted 1.8.1 Appwrite CLI Version: 13.2.1 I want to split code up to share it between my functions. At the momen...