Hi @andrey.gubal,
I have uploaded the sample1.html to cloud only.
Overall I have 2 issues,
Issue #1 - Using cURL API
curl --location 'https://api.aspose.cloud/v4.0/html/conversion/html-docx/sync' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{
"inputPath": "/sample1.html",
"outputFile": "test.docx",
"storageName": "test-storage"
}'
Here, the sample1.html is uploaded to Cloud storage only and hence given the inputPath as “/sample1.html” which I believe is correct (or) let me know if this needs to be given in a different way. Attached the screenshot of my storage below,
Screenshot 2025-01-09 at 4.51.52 PM.png (108.8 KB)
Now, I get a different error response than before,
Status: 404
Response: File with path test.docx was not found
I suppose test.docx is something that will be created by the API only. Not sure why its showing error that test.docx was not found.
Issue #2 - Using Ruby SDK (High Priority)
I’m using below code to convert html to docx with files from my local. I’m using the convert_local_to_local method. After completion, the output docx file looks empty.
However when I used the online converter (Convert HTML To DOCX Online) the output docx was fine.
I have attached the input html and output docx files as a zip file.
test_files.zip (71.1 KB)
# load the gem
require 'aspose_html_cloud'
# Get keys from aspose site.
# There is free quota available.
# For more details, see https://purchase.aspose.cloud/pricing
CONFIG = {
"basePath":"https://api.aspose.cloud/v4.0",
"authPath":"https://api.aspose.cloud/connect/token",
"apiKey":"xx",
"appSID":"xx",
"debug":false
}
api_instance = AsposeHtml::HtmlApi.new CONFIG
src = "/Users/abc/Downloads/sample1.html" # String | Full path to the input file.
dst = "/Users/abc/Downloads/html_to_docx_op.docx" # String | Full path to the result.
begin
#Convert the document from the local file and save result to the local file.
result = api_instance.convert_local_to_local(src, dst)
p result
rescue AsposeHtml::ApiError => e
puts "Exception when calling api_instance.convert_local_to_local: #{e}"
end
Output in console:
I, [2025-01-10T14:36:41.780656 #75574] INFO -- : Temp file written to /var/folders/78/s701vyq508q1xvtf5r7vnvvw0000gp/T/download-, please copy the file to a proper folder with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file will be deleted automatically with GC. It's also recommended to delete the temp file explicitly with `tempfile.delete`
#<AsposeHtml::OperationResult:0x00007fca8a01a570 @code=200, @id="CN-45c9b093-ae35-4272-beb8-3fa4bb55b501", @status="completed", @links={:self=>"/v4.0/html/conversion/CN-45c9b093-ae35-4272-beb8-3fa4bb55b501", :download=>"v4.0/html/file?path=html_to_docx_op.docx"}, @file="/Users/abc/Downloads/html_to_docx_op.docx">
Issue with Ruby SDK is of high priority. Kindly look into this and let us know.