18.1.42 • Published 4 years ago

@syncfusion/ej2-filemanager-ibm-cos-node-file-provider v18.1.42

Weekly downloads
-
License
SEE LICENSE IN li...
Repository
github
Last release
4 years ago

IBM Cloud Object Storage NodeJS file providers for Essential JS 2 File Manager

This repository contains the IBM Cloud Object Storage NodeJS file provider used for Essential JS 2 File Manager component.

Key features

The IBM Cloud Object Storage file provider module allows you work with the IBM Cloud Object Storage. It also provides the methods for performing various file actions such as creating a new folder, renaming files, and deleting files.

The IBM Cloud Object Storage file provider serves the file providers support for the File Manager component with the IBM Cloud Object Storage.

The following actions can be performed in IBM Cloud Object Storage file provider.

ActionsDescription
ReadReads the files from IBM Cloud Object Storage.
DetailsGets a file's details such as Type, Size, Location, and Modified date.
UploadUploads a file in IBM Cloud Object Storage. It accepts uploaded media with the following characteristics: Maximum file size: 30MBAccepted Media MIME types: */*
CreateCreates a new Folder.
DeleteDeletes a folder or file.
RenameRenames a folder or file.
SearchSearches a file or folder in IBM Cloud Object Storage.
CopyCopies the selected files or folders from target.
MoveMoves the files or folders to the desired location.
DownloadDownloads the selected file or folder.

Prerequisites

To run the service, create an IBM Cloud Object Storage for accessing and storing the cloud objects as files or folders. Create an IBM Cloud account and then create Cloud Object Storage bucket to perform the file operations. Then, define the server credentials details such as bucketname, endpoint, apiKeyId, and serviceInstanceId within the config/default.json file found in the config folder as the following code snippet.

"bucketName": "Files",
"endpoint": "s3.xxxxxxxxxxxxxxxxxxxxxxxx.cloud",
"apiKeyId": "GMxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxKGX",
"serviceInstanceId": "cxxn:v1:xxxxxxxxx:cloud-object-storage:xxxxxxxx:a/1651281f453343434e69c7fb70f38cd59b9:xxxxxxx-09xxe-xx-xxxx-a85eexxxxxaaf2e::"

How to configure a web service

Follow these commands to configure the IBM Cloud Object Storage file providers.

  • To install ej2-filemanager-ibm-cos-node-file-provider package, use the following command.
  npm install @syncfusion/ej2-filemanager-ibm-cos-node-file-provider
  • To install the depend packages for the file provider, navigate to @syncfusion/ej2-filemanager-ibm-cos-node-file-provider folder within the node_modules and run the following command
  npm install
  • Now, run the following command line to check the Node API service in local and it will start in http://localhost:8090/.

To configure the port

  • To configure the port, use like this set PORT=3000.

For example:

set PORT=3000 && node index.js

Start the service

To start the service use this command.

npm start

File Manager AjaxSettings

To access the basic actions such as Read, Delete, Copy, Move, Rename, Search, and Get Details of File Manager using IBM Cloud Object Storage file service, map the following code snippet in the AjaxSettings property of File Manager.

Here, the hostUrl will be your locally hosted port number.

  var hostUrl = http://localhost:8090/;
        ajaxSettings: {
            url: hostUrl,
        }

File download AjaxSettings

To perform download operation, initialize the downloadUrl property in AjaxSettings of the File Manager component.

  var hostUrl = http://localhost:8090/;
  ajaxSettings: {
            url: hostUrl,
            downloadUrl: hostUrl + 'Download'
        },

File upload AjaxSettings

To perform upload operation, initialize the uploadUrl property in AjaxSettings of the File Manager component.

  var hostUrl = http://localhost:8090/;
  ajaxSettings: {
            url: hostUrl,
            uploadUrl: hostUrl + 'Upload'
        },

File image preview AjaxSettings

To perform image preview support in the File Manager component, initialize the getImageUrl property in AjaxSettings of the File Manager component.

  var hostUrl = http://localhost:8090/;
  ajaxSettings: {
            url: hostUrl,
            getImageUrl: hostUrl + 'GetImage'
        },

The FileManager will be rendered as follows.

File Manager

Support

Product support is available through the following mediums:

License

Check the license details here.

Changelog

Check the changelog here

© Copyright 2020 Syncfusion, Inc. All Rights Reserved. The Syncfusion Essential Studio license and copyright applies to this distribution.