我有要转换为文档文件的html文本。我尝试了CloudConvert API控制台(https://cloudconvert.com/api/convert/html-to-doc)来生成请求。在代码段> html表格中,这为我提供了以下形式:
<form action="https://api.cloudconvert.com/convert" method="POST" enctype="multipart/form-data">
<input type="hidden" name="apikey" value="MyAPIKey">
<input type="hidden" name="inputformat" value="html">
<input type="hidden" name="outputformat" value="doc">
<input type="hidden" name="input" value="raw">
<input type="hidden" name="file" value="<p>test</p>">
<input type="hidden" name="filename" value="test.doc">
<input type="hidden" name="wait" value="true">
<input type="hidden" name="download" value="true">
<input type="submit" value="Convert!">
</form>
但是这不起作用,我经常遇到相同的错误:
{"error":"The filename parameter should be the name of the input file, not of the output file!","code":400}
错误是错误的,因为这里没有输入"文件";并且需要输出文件的名称 - 如果我将文件名参数排除在外,也会抱怨。
我在这里做错了什么,或者有任何可以将html转换为.doc或.docx格式的替代服务?
将 filename
设置为 test.html
(正如错误消息所说,它应该是 input 文件的名称)。