-1

Go to this page: https://products.office.com/en-us/office-online/view-office-documents-online

If you paste a url of an office document(e.g. http://ieee802.org:80/secmail/docIZSEwEqHFr.doc) to the input box and click "create url", it will generate a url which allows you to view the file in browser.

However this doesn't work for a signed url: 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

It expires after 15min so by the time anyone sees this it must have been expired, but I guarantee it is a valid url and if you paste that in browser it will download that doc. This was working about 2 months ago, but not working now, I wonder if Microsoft has changed something, does anyone know the reason?

Xiao Li
  • 1
  • 1

1 Answers1

2

I was having the same issue. Eventually, I found out that the URL was not being encoded. The signed url introduces characters to the URL that must be "escaped" or encoded for the Microsoft Office Viewer to be able to read them. See this other question for more information.

I had to encode it with encodeURIComponent()

Note that encodeURI() will not fix the issue. It does not encode as many characters that encodeURIComponent does.