PageOffice保存时The file format is not allowed

发布时间 2023-11-02 10:01:42作者: 0Behavior

情景描述:最新用PageOffice做word在线编辑功能,但是保存时一直报错The file format is not allowed。如下图:

问题分析:把word文件放到官方demo中,编辑保存没有问题,最后排查到是pageofficeCtrl.WebOpen传入的参数DocumentURL问题。

//保存时出现错误
pageofficeCtrl.WebOpen("C:\\Resource\\FileManage/2023/11/01/2023110209125700000AR.docx", OpenModeType.docRevisionOnly, "tom");
//保存时成功
pageofficeCtrl.WebOpen("C:\\Resource\\FileManage\\2023\\11\\01\\2023110209125700000AR.docx", OpenModeType.docRevisionOnly, "tom");

解决方案:参数DocumentURL不要用/,虽然可以正常加载word文件,但是保存时就有问题。