2
votes

I'm working on a Joomla website, which has a set of documents that needs to displayed using a Google Docs viewer.

Though only Authenticated users can reach the file, but the file can also be access through direct path like http://www.example.com/files/somefile.pdf even without authentication.

So when i tried to view a file through Google Viewer with a link something like this..

http://docs.google.com/viewer?url=http://www.example.com/files/somefile.pdf

The files which are of size less than 100kb are viewable and for rest all an error message is displayed as:

Sorry, it took too long to find the document at the original source. Please try again later. You can also try to download the original document by clicking here.

So I'm not sure whether this is something to do with the Google Doc Viewer, Joomla or any Server issue for request timeout.

How can I make each file irrespective of size viewable with Google Docs?

1
I can just say that it is very unlikely that joomla has any influence on this since google get's an URL as parameter which does not depend on Joomla. It might be influenced by any .htaccess you have (from Joomla). But in my opinion this would not explain why smaller files work and larger files not. - Arno
Here are Viewer's limitations: support.google.com/drive/answer/37603?hl=en - WooDzu
Why don't you try to solve the people can see without authentication problem? Are there new documents added frequently or are there a small number of fixed documents? - Elin

1 Answers

0
votes

If its PDF only, you can also just use pdfjs from Mozilla directly. Then you should check your URL encoding. If the issue remains, check out https://code.google.com/p/google-api-php-client/ for converting your docs in-place. Opening them with pdfjs is still recommended to bypass Google-Doc-Viewer problems, at least that is how I could get this working properly.