Skip to content

Commit 1cd0bdc

Browse files
committed
update readme
1 parent ad8b651 commit 1cd0bdc

File tree

1 file changed

+30
-28
lines changed

1 file changed

+30
-28
lines changed

README.md

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -75,35 +75,37 @@ To get started with Aspose.Cells Cloud for Node.js, follow these steps:
7575

7676
1. Create an account at [Aspose for Cloud](https://dashboard.aspose.cloud/#/apps) and obtain your application information.
7777
2. execute `npm install asposecellscloud --save` from the command line to install Aspose.Cells Cloud for Node.js via NPM.
78-
78+
3. You need to set your CellsCloudClientId and CellsCloudClientSecret in the environment variables.
7979
```js
80-
var fs = require('fs');
81-
var path = require('path');
82-
var assert = require('assert');
83-
const localPath = "../TestData/";
84-
describe('cellsWorkbookPutConvertWorkbook', function() {
85-
it('should call cellsWorkbookPutConvertWorkbook successfully', function() {
86-
const cellsApi =new api.CellsApi(clientId, clientSecret);
87-
const filename = "Book1.xlsx";
88-
var data =fs.createReadStream(localPath + filename);
89-
var req = new model.UploadFileRequest();
90-
req.path = "Temp/" + filename;
91-
req.file = data;
92-
93-
return cellsApi.uploadFile(req)
94-
.then(() => {
95-
var req = new model.CellsWorkbook_PutConvertWorkbookRequest({
96-
workbook : fs.createReadStream(localPath + filename),
97-
format : "pdf",
98-
});
99-
100-
return cellsApi.cellsWorkbookPutConvertWorkbook(req)
101-
.then((result) => {
102-
expect(result.body.toString().length).to.greaterThan(0);
103-
});
104-
});
105-
});
106-
});
80+
import { CellsApi, PutConvertWorkbookRequest, UploadFileRequest } from "asposecellscloud";
81+
var fs = require('fs');
82+
var path = require('path');
83+
var process = require('process');
84+
const _ = require('asposecellscloud');
85+
86+
const cellsApi = new CellsApi(process.env.CellsCloudClientId, process.env.CellsCloudClientSecret);
87+
88+
var remoteFolder = "TestData/In"
89+
var localPath = "../TestData/CellsCloud/"
90+
var localName = "Book1.xlsx"
91+
var remoteName = "Book1.xlsx"
92+
93+
var localNameRequest = new UploadFileRequest();
94+
localNameRequest.uploadFiles ={localName:fs.createReadStream(localPath + localName)};
95+
localNameRequest.path = remoteFolder + "/" + remoteName ;
96+
localNameRequest.storageName ="";
97+
cellsApi.uploadFile(localNameRequest );
98+
99+
var format = "csv"
100+
101+
var mapFiles: { [key: string]: any } = {};
102+
103+
mapFiles[localName]= fs.createReadStream(localPath +localName) ;
104+
105+
var request = new PutConvertWorkbookRequest();
106+
request.file = mapFiles;
107+
request.format = format;
108+
var response = cellsApi.putConvertWorkbook(request);
107109
```
108110

109111
## Aspose.Cells Cloud in Popular Languages

0 commit comments

Comments
 (0)