Viewing a document located in cloud storage like Google Drive, Dropbox or OneDrive

Discussions about DocuVieware integration in GdPicture.NET.
Post Reply
lchorley
Posts: 19
Joined: Tue Mar 22, 2022 3:10 pm

Viewing a document located in cloud storage like Google Drive, Dropbox or OneDrive

Post by lchorley » Thu Mar 24, 2022 2:47 pm

Hello Team GdPicture,

We've been trying to determine if DocuVieware is capable of displaying documents directly from cloud file storage platforms, like Google Drive, Dropbox or OneDrive, using a (generally accessible) link that would normally show it's own viewer with an option to download the file. Of course a direct download link to the original file is not easy nor in general not possible to come by.
I've tried with several examples so far and DocuVieware tends to give a blank white page in these cases.
I've searched quite a bit through forums and documents and found no trace of this use case.

Is it something that you support explicitly and if not, are there workarounds that you know of ?

Thank you in advance,
Loren

User avatar
Fabio
Posts: 173
Joined: Thu Aug 27, 2020 9:57 am

Re: Viewing a document located in cloud storage like Google Drive, Dropbox or OneDrive

Post by Fabio » Fri Mar 25, 2022 11:34 am

Hello Loren,

You can use our LoadFromURi methods to load a file from your URi:
Javascript -> https://www.docuvieware.com/guides/aspn ... omUri.html
.NET -> https://www.docuvieware.com/guides/aspn ... omUri.html

The cloud storage solutions provide links to get your file, but there are no real "direct download" links since there are some redirections. Each cloud solution has its own workaround to get the files.

GDrive

The trick is to set this URI instead of the one provided by GDrive: https://drive.google.com/uc?export=download&id=[ID OF YOUR DOCUMENT]

OneDrive

For Onedrive it's a bit complicated. You need to generate the HTML code by clicking on the "embed" option, get the URI within the HTML code, and replace "embed" with "download". It should look like this: https://onedrive.live.com/download?cid= ... S6x7k&em=2

DropBox

The trick is to add "raw=1" at the end of the request. Example: https://www.dropbox.com/s/zuzefzybu6uy9 ... .pdf?raw=1

Best regards,
Fabio

lchorley
Posts: 19
Joined: Tue Mar 22, 2022 3:10 pm

Re: Viewing a document located in cloud storage like Google Drive, Dropbox or OneDrive

Post by lchorley » Fri Mar 25, 2022 12:50 pm

Amazing, thank you Fabio !
I'll give implementing these solutions a go very soon.

Have a good day
Loren

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest