签名网址不适用于Microsoft在线ducument查看器

时间:2017-11-02 03:55:18

标签: documentviewer pre-signed-url

转到此页面: https://products.office.com/en-us/office-online/view-office-documents-online

如果您将办公室文档的网址(例如http://ieee802.org:80/secmail/docIZSEwEqHFr.doc)粘贴到输入框并点击“创建网址”,它会生成一个网址,您可以在浏览器中查看该文件。

但是,对于已签名的网址,这不起作用: https://test-sam-sydney.s3.amazonaws.com/561/smartlibs/141/entries/16288/files/32683/aaa.doc?AWSAccessKeyId=ASIAI37CPWZSXOXMYGWA&Expires=1509595541&Signature=czEeo7dko8%2Fj96AYX9HTK5dV8IU%3D&x-amz-security-token=FQoDYXdzEP3%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDJ%2FRBcrYuZWaVCkhTSKoBvKIryDttKvnIMTdcNvRwlURajDqOsmDn2AGGWfuh%2BfXAZ9HkMHbP7boPcPaz2n1YG0HibDeuVp1haOBqxjylleC0XtSCIYF6zOGGP9TYAoncUx29z3NDL4tVdfkvxus8kV8sCuMPleiocAkIYeWnfTAGIc%2B7bDzx4DlkOaBtmYpY5XFWGJTGhS7kN%2Bv8qYE53gbWI0yv6w7SDC8bREW8EgH0Nt4Zi5i87psPgjAqmW9JypIcUdIKY%2FhZ7%2BE9Cmpvvqwt2t8aYFAT2X5FVgTQbImFcJrRTjx3kDNJgrI6TVpoC1kKt%2B15EBjYYWP9XECfFGeID%2F3MqluU4XBagHZ45vI5phska6nLyyWHq0%2FgGK06lLW%2BPJpCl%2Bg2u2XEy%2B%2FaqoNhoWNKeo7YQ9IP9LS2rkqZJ5Wm4RzD6VDV0waUDOOCR0iwQl9C8bkhFLxi6cYv6MViO5EYxZygaxmtKh%2FVC1BcoRL4XRq6WP%2BHIQiVaA67PXfyMspoGk3Wn31zwhAGsRRi2%2Fh5kEiJ7wXw%2FYCppokL7VBogEDIyuv5HgXtOLsPvMsEdbwEvNNLYYvTMmby911%2FChbzLVgn7I4ui1C5eqwJosZWyjwbQWrwzvNPYi9xqty%2B9Fja3YlmMUUjBe5eDkKzPEUDGZ28beckUU%2FhDptseaZDehmmsODwQd5AFmJ0MUdXH6E333N3rgLo%2BvmSptLrRcd%2BIfpiV8cNdMyXsK3k2%2FSblpRA5rMsP4gbMiveXMmHGtcsonjMipuyjWReWb5z5S%2BcIeeZLjOVBDtqyYdixDsqj62q9K5qGRPiKBeWHO6IP9IzqM4EY8GfKpVy2GEE30tdx9MB94pQmQSMNEUigREYuELKvrS4kbUXiTNZ635pqxEDeBq%2FHP3iOlodbvqIEFeS0iG2X46Sc%2FZ1sixPW1umvNkNJCABjHcPvupIWwzqdiA6N6V%2FTb%2FVZHbBBHqkv4quBn8xGm3LORiuEsXRoRTVMeor2sdOu6nhJuAHz9IpdPvnqQ4mExsBWOY4lMD5sOZ1PoGuDThbcDFc4LfBK96jRC8KCF%2BEiP1FUjVhtw4nkMhpq0ojazqzwU%3D

它会在15分钟后过期,所以当有人看到它时它必定已经过期,但我保证它是一个有效的URL,如果你在浏览器中粘贴它,它将下载该文档。 这是在2个月前工作,但现在不工作,我想知道微软是否改变了一些东西,有人知道原因吗?

1 个答案:

答案 0 :(得分:1)

我遇到了同样的问题。最终,我发现该URL没有被编码。签名的url将字符引入URL,这些字符必须“转义”或经过编码才能使Microsoft Office Viewer能够读取它们。有关更多信息,请参见this other question

我不得不用encodeURIComponent()

对其进行编码

请注意,encodeURI()无法解决该问题。它不能像encodeURIComponent那样编码许多字符。