Corrupted docx generated using zipping

霸气de小男生 提交于 2019-12-05 17:09:44

I think I've got what's wrong.

When I opened your corrupted File, and opened it on winrar, I saw antislashes at the beginning of the folders, which is unusual:

When I rezip the file after unzipping it, the antislashes are not there anymore and the file opens in Word so I think it should be the issue.

I think the code is wrong here:

String outFile = externalPath + java.io.File.separator + fileName;  

should be

if (externalPath=="")
    String outFile = externalPath + fileName;  
else 
    String outFile = externalPath + java.io.File.separator + fileName;  
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!