• 0
cflapt

Embed Within A Datapage, A Pdf Stored On Caspio Database

Question

9 answers to this question

  • 0

caspio file link is something like http://b4.caspio.com/dpimages.asp?appkey=dpimages.asp?appkey=c82f1000a638090d2a1c40058bce&file=FILENAME&file=[@field:MyFile] and in the iframe you also have link so if you replace the file link it will be something like:

 

<iframe src="http://docs.google.com/gview?url=http://b4.caspio.com/dpimages.asp?appkey=dpimages.asp?appkey=c82f1000a638090d2a1c40058bce&file=FILENAME&file=[@field:MyFile]&embedded=true" style="width:718px; height:700px;" frameborder="0"></iframe>

 

This way you are using a link inside another link with parameters which is confusing for the browser!

 

Therefore you need to get the URL of the file which is on an external server ;)

Share this post


Link to post
Share on other sites
  • 0

I can't believe there is not a way to view PDFs within Caspio without downloading. If the PDF contains private information then if a user is on their home computer and they view the PDF the PDF will be download to their home computer. 

Share this post


Link to post
Share on other sites
  • 0

caspio file link is something like http://b4.caspio.com/dpimages.asp?appkey=dpimages.asp?appkey=c82f1000a638090d2a1c40058bce&file=FILENAME&file=[@field:MyFile] and in the iframe you also have link so if you replace the file link it will be something like:

 

<iframe src="http://docs.google.com/gview?url=http://b4.caspio.com/dpimages.asp?appkey=dpimages.asp?appkey=c82f1000a638090d2a1c40058bce&file=FILENAME&file=[@field:MyFile]&embedded=true" style="width:718px; height:700px;" frameborder="0"></iframe>

 

This way you are using a link inside another link with parameters which is confusing for the browser!

 

Therefore you need to get the URL of the file which is on an external server ;)

Hey MayMusic,

 

If I understand you correctly this will only use the google docs viewer to display the document, the file itself will be stored on caspio.

 

Is there any risk to the file having any information captured by google?

 

I am also dealing with potentially sensitive information but a key element to moving our company paperless will be this type of viewing platform.

 

Thank you!

Share this post


Link to post
Share on other sites
  • 0

Hello DataCobalt,

 

If I understand correctly, the Google viewer cannot display files that are stored on caspio now.

 

The reason, if I understand correctly, is: the link to a file is like

http://eu1.caspio.com/dpImages.aspx?appkey=APPKEY&fileID=FileID

In other words, the link uses parameters.

 

But the Google viewer uses parameters also:

iframe src="http://docs.google.com/gview?url=URL&embedded=true" style="width:718px; height:700px;" frameborder="0"

 

If a link to a file on caspio is pasted instead of URL, the code will be like:

iframe src="http://docs.google.com/gview?url=http://eu1.caspio.com/dpImages.aspx?appkey=APPKEY&fileID=FileID&embedded=true" style="width:718px; height:700px;" frameborder="0"

 

But two "?" sings in the same URL do not work.

Share this post


Link to post
Share on other sites
  • 0

Would it be possible with making the second "?" a "%" in this case since it is an iframe?

 

Or is there another workaround?

 

At this point having the forms stored in another place isn't really an option for us.

Share this post


Link to post
Share on other sites
  • 0

As far as I know, making the second "?" a "%" does not work, but you can try yourself.

I will be thankful if share your experience.

 

I cannot find another workaround at the moment, but maybe anybody else can propose his/her solution.

Share this post


Link to post
Share on other sites
  • 0

Google viewer frame will display embed document from Caspio if you encode the URL link of file stored inside Caspio account:

So, URL link will look like this:

https%3A%2F%2Fe1.caspio.com%2FdpImages.aspx%3Fappkey%3D____%26fileID%3D_____

I have used following link to generate the encoded URL.

Hope this helps

Share this post


Link to post
Share on other sites
  • 0
On 5/24/2017 at 7:49 AM, Vitalikssssss said:

Google viewer frame will display embed document from Caspio if you encode the URL link of file stored inside Caspio account:

So, URL link will look like this:


https%3A%2F%2Fe1.caspio.com%2FdpImages.aspx%3Fappkey%3D____%26fileID%3D_____

I have used following link to generate the encoded URL.

Hope this helps

Are you sure this works?

I am encoding the URL with Javascript, but every time I get a "No Preview Available" message. When I decode the URL back, it downloads fine... 

Here is my code: 

<iframe id="iframe_pdf" style="width:80%; height: 1100px; display: none;" align="middle" frameborder="0"></iframe>
<script>
    window.onload = function(){
        if(!("[@field:cs_form/]" == "")){
           embed_pdf();
        }   
    }
    function embed_pdf(){
        var google_link= "https://docs.google.com/gview?url=";
        var google_param = "&embedded=true";
        var pdf_link = "[@field:cs_form/]";
        var encoded_pdf_link = encodeURIComponent(pdf_link);
        
        var iframe_window = document.getElementById("iframe_pdf");
        
        iframe_window.style.display = "block";
        iframe_window.src=google_link + encoded_pdf_link + google_param;
    }
</script>

EDIT: I found out why it wouldn't show, the datapage was authenticated. And unless you are signed in OR Un-authenticate the datapage, you will not be able to see the PDF. Now... is there a way to pass google the authentication... 

Edited by JoshuaJobin
Found new information

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now