dongzhiju0324 2013-05-21 12:07
浏览 34

如何在Google Docs中显示数据库中的pdf文件?

Here is my code.

<a href="http://docs.google.com/viewer?url<?php echo $file_row['floc']; ?>"> <i class="text-warning">View </i></a>

It echos the file.pdf in the database, when I clicked the link I want to redirect in Google docs. the google docs said they cannot find the specified folder.

Can someone help me to view the files into Google Docs after i clicked the link?

  • 写回答

1条回答 默认 最新

  • doudouxuqh198138 2013-05-21 12:15
    关注

    Try rawurlencode() and do not forget about = here ?url=:

    <a href="http://docs.google.com/viewer?url=<?php echo rawurlencode($file_row['floc']); ?>">
    

    But your $file_row['floc'] does not contain an URL:

    http://www.domain.com/uploads/4145_File_app-developer-guide-2.4.pdf
    

    a path only:

    uploads/4145_File_app-developer-guide-2.4.pdf
    

    Try add a schema and a domain:

    <a href="http://docs.google.com/viewer?url=http://domain.com/<?php echo rawurlencode($file_row['floc']); ?
    
    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog