【发布时间】:2020-01-24 19:04:40
【问题描述】:
当我尝试使用 .Net SDK 将大型文档添加到 Watson Discovery 时出现错误。当文件大于 11MB 时会出现问题。我尝试在多个环境和集合上添加相同的文档。当文件小于 11MB 时,下面的代码可以完美运行。
代码:
byte[] content = File.ReadAllBytes(@"D:\test\A17_FlightPlan.pdf");
using (MemoryStream ms = new MemoryStream(content))
{
try
{
var document = discoveryService.AddDocument(
environmentid,
collectionid,
ms,
"A17_FlightPlan.pdf",
"application/pdf",
null);
}
catch (Exception ex)
{
Console.Write(ex.ToString());
}
}
错误:{“API查询失败,状态码为InternalServerError:INKApi错误| x-global-transaction-id:|错误:”}
【问题讨论】:
标签: .net sdk ibm-watson discovery