Learn Catalyst Series #4 : File Operations with File Storage

Learn Catalyst Series #4 : File Operations with File Storage

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

https://fileupload-downloadservice-698833516.development.catalystserverless.com/server/file_upload_service_function/upload

You need to send the file as multipart form data in a key named "data".

to get the list of files 

https://fileupload-downloadservice-698833516.development.catalystserverless.com/server/file_operations/getFileDetails

to delete a file 

https://fileupload-downloadservice-698833516.development.catalystserverless.com/server/file_operations/deleteFile/<file_id>;

to update a file 

https://fileupload-downloadservice-698833516.development.catalystserverless.com/server/file_operations/updateFile/<file_id>;

You need to send the file as multipart form data in a key named "data".

Follow the steps below to recreate the above project

  1. Create a Project in Catalyst

  2. Create a Folder in the File Storage

  3. Note the folder id

  4. Now replace the folder id in the code (refer to GitHub for the code and the comments)

  5. 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


      Catalyst Community