Rank 1: Thread
Since the storage system of each client is different, the saving is done in the backend instead of in the appwrite function
Votes
0
Replies
24
Participants
Unknown
Messages
25
Rank 1: Thread
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?
Rank 1: Thread
These are management applications made in vue3 in the frontend part and Typescript in the backend part.
Rank 1: Thread
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?
Rank 1: Thread
Yes, i dont use nuxt only vue but its the same.
Rank 1: Thread
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
Rank 1: Thread
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.
Rank 1: Thread
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
Rank 1: Thread
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?
Rank 1: Thread
Yes
Rank 1: Thread
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);Rank 1: Thread
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
Rank 1: Thread
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
Rank 1: Thread
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
Rank 1: Thread
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.
Rank 1: Thread
But we agree that the file system is the best option.
makes sense. thanks for the insight 👍🏼
Rank 1: Thread
Thanks 4 all @Steven