File in Catalyst File Store; Get file name

File in Catalyst File Store; Get file name

You can use the getFileDetails method available in the Node SDK in order to get the name of a file before downloading it. A sample code snippet for getting file name and other file details is as follows : 

  1.     let filestore = app.filestore();
  2.     let folder = filestore.folder(FOLDER_ID);
  3.     let detailsPromise = folder.getFileDetails(FILE_ID);
  4.     detailsPromise.then((fileDetails) => {
  5.         console.log(fileDetails);
  6.     });

    • Related Articles

    • Multiline text fields in the Catalyst Data Store

      You can create your application with multiline text and rich text fields and use the text datatype available in the Catalyst Datastore in order to save the contents of those fields. You can find the help documentation regarding the same here. 
    • Code sample to upload files in File Store using Java

      import java.io.File; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import ...
    • Attaching a file from File Store in an email

      As of now, we do not have the support for attaching files while sending email.  For now, we would suggest you to upload the file to the Catalyst Filestore, and create an URL for the same using the Catalyst functions and share the URL via mail to ...
    • Catalyst File Store ,"message":"socket hang up","value":{"code":"ECONNRESET"}

      {"code":"api/request_failure","message":"socket hang up","value":{"code":"ECONNRESET"}}. The ECONNRESET issue might occur if you have not handled the error with a try catch block in your code and the “catalyst serve” command is running. You can check ...
    • Need to access files from File Store for Web Client Hosting

      If your application is hosted in Catalyst, then you can use the download link of the file itself to render the same in your Web Client.  For Example : <img src=“/baas/v1/project/1611000000****/folder/1611000000012142/file/16110000000*****/download> ...