Page 1 of 1

Give file access to Google Doc Viewer

PostPosted: August 26th, 2011, 12:09 pm
by atreidex
Hello everyone!

Is there any simple way to give access to protected files for Google Doc Viewer.
I want to download-protect a DOC file and then include it in a page using a plugin like "Google Doc Embedder".
However, s2member sees the Google server as a unregistered member and i get a "sorry-no access" error when trying to see the file in the preview frame.

Any help / tip is greatly appreciated.

Cheers,
Ciprian

Re: Give file access to Google Doc Viewer

PostPosted: August 27th, 2011, 1:02 am
by Cristián Lávaque
Hi Ciprian. I emailed Jason asking him how it could be done. :)

Re: Give file access to Google Doc Viewer

PostPosted: August 27th, 2011, 2:29 pm
by Jason Caldwell
Ordinarily, if you were going to integrate with a 3rd-party tool like Google's Doc Viewer, you would integrate your protected file with "Advanced Download Restrictions" ( i.e. using a Download Key ), as is discussed in your Dashboard, under: s2Member -> File Downloads -> Advanced Download Restrictions.

For example, this should work:
Code: Select all
http://docs.google.com/viewer?url=<?php echo urlencode(site_url("/?s2member_file_download_key=".s2member_file_download_key("/file.doc")."&s2member_file_download=/file.doc")); ?>

However, upon testing this specifically with the Google Doc Viewer, it does not work. I suspect this has something to do with limitations in the Google Doc Viewer though, because this technique has been confirmed to work with a variety of other services. If anyone figures out how to make this work with Google Doc Viewer, please share :-)

Re: Give file access to Google Doc Viewer

PostPosted: August 27th, 2011, 5:03 pm
by Jason Caldwell
Setting up a virtual directory with mod_rewrite might allow this to work with Google Doc Viewer?
See discussion here if you'd like to try this: viewtopic.php?f=4&t=14643#p32717