Package Exports
- @zapscloud/zapsstorage
- @zapscloud/zapsstorage/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@zapscloud/zapsstorage) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
zapsstorage
Zapscloud Storage API Client
Initialize Library with config values
var zapsstorage = new ZapsStorage({
app: 'appname',
authkey: ' ',
authsecret: ' '
})Snippet for File Upload
Upload a file with public access url
var imagesfolder = 'students/images'
zapsstorage.uploadFile(imagesfolder, '/data/images/merchant_shop.png', true)
.then(function (response) {
console.log('Upload Response', response)
})
.catch(function (err) {
console.log('Error Upload', err)
});Snippet for Get File Details
Get File Details by Uploaded File
zapsstorage.getFileDetail(imagesfolder+'merchant_shop.png')
.then(function (response) {
console.log('Response File Details', response)
})
.catch(function (err) {
console.log('Error Insert', err)
});Snippet for Get File List
Get File Details by Uploaded File
zapsstorage.getFileList(imagesfolder)
.then(function (response) {
console.log('Response File & Folder List', response)
})
.catch(function (err) {
console.log('Error Insert', err)
});Snippet for File Download
Download a file in given folder
zapsstorage.getFile(imagesfolder+'merchant_shop.png','/download/images')
.then(function (response) {
console.log('Download Response', response)
})
.catch(function (err) {
console.log('Error Download', err)
});Snippet for Remove Uploaded File
Remove uploaded file using file id
zapsstorage.removeFile(imagesfolder+'merchant_shop.png')
.then(function (response) {
console.log('Response Remove File', response)
})
.catch(function (err) {
console.log('Error Remove File', err)
});