I have run into a small dilemma, I use Dropbox as a trigger to execute my workflow. It listens for a new file with an .xlsx file extension, and executes another step to a Cloudmersive api call to convert the file to a .csv file.
The trigger works great and the call in Cloudmersive works great, but apparently Cloudmersive can’t determine the location of the file from the Dropbox trigger.
Code that runs, and the result.
var fs = require(‘fs’)
var CloudmersiveConvertApiClient = require(‘cloudmersive-convert-api-client’);
var defaultClient = CloudmersiveConvertApiClient.ApiClient.instance;
// Configure API key authorization: Apikey
var Apikey = defaultClient.authentications[‘Apikey’];
Apikey.apiKey = ‘I Place my key here…’;
var apiInstance = new CloudmersiveConvertApiClient.ConvertDocumentApi();
// HERE’S THE REFERENCE TO FILE
var inputFile = Buffer.from(fs.readFileSync( steps.trigger.event.path_lower ).buffer);
// File | Input file to perform the operation on.
var opts = {
‘outputEncoding’: “outputEncoding_example” // String | Optional, set the output text encoding for the result; possible values are UTF-8, ASCII and UTF-32. Default is UTF-8.
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ’ + data);
}
};
apiInstance.convertDocumentXlsxToCsv(inputFile, opts, callback);
Error ENOENT: no such file or directory, open ‘/invoicedatafiles/expenses06-04-21.xlsx’
Is there a prefix to identify the location of the file in the Dropbox folder?
Thanks,
Scott.