Google doc viewer with bytestream

831 Views Asked by At

I am trying to use google document viewer. Could not find any documentation for this.

If you have a publicly accessible document it works fine. But all documents are stored as blobs in my mvc app. So I am trying to do something like this

https://docs.google.com/viewer?embedded=true&url=https://example.com/mycontroller/myaction?param1=10&userSig=mysignature

Controller returns

return File(
                <byte array  byte[]>,
                MediaTypeNames.Application.Octet,
                documentResponse.Data.DocumentName);

But it's not returning any preview. Want to know is this possible to do? or it only supports publicly accessible file?

1

There are 1 best solutions below

0
Dhanuka777 On

Code actually works, issue was it was breaking before hitting return.