Continuing on our Let us Learn Catalyst series, today, let us learn how to handle the FileStore from Catalyst.
Imagine a scenario that you need to upload files to the cloud as you are running out of space or you just need your files to be accessible whenever you are on the move irrespective of the device you are on. You can use File Storage by Catalyst.
Because Catalyst gives you the ability to make REST APIs with ease, we will write and invoke the APIs to show the various CRUD operations.
Let us look at the UI first
Let us try uploading a file first.
If you notice, all that you need to do is to invoke function calls :
to upload a file
You need to send the file as multipart form data in a key named "data".
to get the list of files
to delete a file
to update a file
You need to send the file as multipart form data in a key named "data".
Follow the steps below to recreate the above project
Create a Project in Catalyst
Create a Folder in the File Storage
Note the folder id
Now replace the folder id in the code (refer to GitHub for the code and the comments)
Now run Catalyst Deploy and the response that you get now are the endpoints that you need to work with.
Pls find the Github link - https://github.com/catalystbyzoho/learncatalyst-filestoreoperations-node
We would like to think that we can and do make a difference. As usual, we would love to hear from you on how you went about using Catalyst.
We welcome all queries from you, which you can either post here or you can write to us at support@zohocatalyst.com.
Await for the next post in the Learn Catalyst Series.
- Team Catalyst