But I am not able to find converted file in my azure storage account file share. I am not able to find it in my mounted folder in pod as well.
Please also note that I am already using aspose on Premise for conversion of excel to pdf and was getting converted files in azure file share. So ideally, this converted file should also be present in that file share right?
@rajatdpw,
Once again, I think carefully about the question you raised.
From your query parameters, the converted file should be stored in the folder of Aspose Cloud Default Storage, where you can find your output file.
If you still can’t find the file, we can take a different approach to this problem.
Remove the “outpath” of the query parameters, the response content by the convert API is a file stream, and you can write this file stream directly to your file.
let result = await axios(configuration);
let buffer = Buffer.from(result.data, ‘binary’);
fs.writeFileSync(localPath, buffer);
The file that I get looks corrupted. I have attached with the message. Please let me know if you find any way to get the file correctly.
File link: https://docserqablobs.blob.core.windows.net/dtlp-file-storage-qa/targaryen/12345/testFile/test.xlsx?st=2023-10-17T04%3A26%3A44Z&se=2023-10-25T04%3A26%3A44Z&sp=r&spr=https&sv=2018-03-28&sr=b&sig=iITOd9yrHthtD3EyKVDalyWl%2BeDhwkYwAw80A04HhSE%3D
@rajatdpw ,
I have reviewed the provided file, and it appears to have been generated by Aspose.Cells 23.1.1.
I would like to inquire about when and under what circumstances this file was created.
I am trying to convert an excel file from html file. So, I used the on premise approach. I get above response as I try to do it as discussed with said approach (without providing outPath). Docker image is aspose/cells-cloud:linux.23.1.1
@rajatdpw ,
I understand. I will set up a simulation of your runtime environment and conduct further testing. Additionally, have you had a chance to try the latest version of Aspose.Cells Cloud?
@rajatdpw,
By simulating your operating environment, I was able to reproduce the issue of file missing. I have now generated a new support ticket for this problem and will provide a fresh solution as soon as possible.
Please refer to the following code, which is functional for converted file output. Additionally, I will release an updated version of the Docker image file as soon as possible.
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
const { readFile } = require('fs/promises');
const htmlStream = fs.createReadStream('ToxXlsx.html');
async function convertHtmlToExcel() {
console.log('Begin to convert Html to Excel.');
let data = new FormData();
let randomStr = Math.random().toString(36).slice(2, 8);
let outputFileName = `output-${randomStr}.xlsx`;
let outputDatafolder = 'htmlToExcelFilesData';
let outputFilePath = outputDatafolder + '/' + outputFileName;
data.append('file', htmlStream);
let configuration = {
method: 'put',
url: 'http://localhost:47901/v3.0/cells/convert?format=XLSX&checkExcelRestriction=true&streamFormat=html',
responseType : 'stream',
headers: {
'accept': 'application/json',
'Content-Type': 'application/json',
...data.getHeaders()
},
data: data
};
try {
const response = await axios(configuration);
response.data.pipe(fs.createWriteStream('ConvertHtml.xlsx'));
} catch (error) {
console.error('Error:', error.message);
}
console.log('End.');
}
convertHtmlToExcel();