谷歌文档查看器返回204响应,不再工作,替代品? [英] Google Docs viewer returning 204 responses, no longer working, alternatives?

查看:312
本文介绍了谷歌文档查看器返回204响应,不再工作,替代品?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新2016-11-16 9:53 EST



即使Google声称已经解决了这个问题。当我自己测试50次文档的加载时,其中3次Google返回了204响应。



请访问此URL并发布您的不满意见,以便我们终于可以让Google解决并解决问题:



我们的网络软件使用并依赖Google文档查看器服务将文档嵌入到我们的网站(通过iframe)和让我们的客户无需打开单独的应用程序即可查看文档(通过访问URL)。此功能由Google提供了相当长的一段时间,并且工作完美!

示例浏览器网址:

  https://docs.google.com/viewer?url=http://www.pdf995.com/samples/pdf.pdf 

然而,我们开始注意到,我们试图加载的文件只会加载很少。我们最初认为他们的服务器存在问题,因此开始调查我们收到的标题响应。特别是,我们注意到几乎每个请求都返回了204无内容响应。偶尔我们会收到200个回应。



以下是我们收到的204个回复之一的示例:



下面是我们得到的200个答案中的一个例子(非常罕见):

我结束了此页面



鉴于Google专家回复此人的类似查询,我们的问题如下:


我的问题如下:

ol>
  • 是否有其他人知道Google是否正式停止支持Google查看服务?

  • 有没有人知道更新过的类似Google产品/服务(或许Google Drive?),它允许一个人完成与上面提到的查看器服务完全相同的功能?理想情况下,我希望有一个简单的网址,我可以引用外部文档,该文档不必存在于Google服务器上,但仍可以驻留在我的服务器上。


  • 您可以建议允许我将文档(如Word文档,Excel文档,PowerPoint文档和PDF)嵌入到允许用户查看网页的网站中的其他可比较的和free 服务是什么?浏览器中的文件,而无需将这些应用程序实际安装在他们的系统上。

  • ,我只想说,对于所有优秀的Google来说,这是令人难以置信的愤怒,令人沮丧和烦恼,他们可以提供人们长期依赖的服务,并突然拉上它。我相信除了我自己之外,还有很多其他人不会对这种决定表达担忧。 Google解决了这个问题,并且在我的书中仍然很棒: - )



    感谢您提供的答案!

    解决方案

    我运行的服务也依赖于嵌入Google文档查看器,我也遇到过这个问题。我找不到任何其他类似的服务(免费或其他)。



    我想出了一个'hack',可以帮助您摆脱使用Google Doc Viewer 。它确实需要JQuery。我所做的是每2秒钟刷新一次iframe,直到它最终正确加载。我还用加载gif来覆盖iframe,以隐藏持续刷新。我的代码:

     < style> 
    .holds-the-if​​rame {
    background:url(/img/loading.gif)center center no-repeat;
    }
    < / style>

    < div class =holds-the-if​​rame>
    < iframe id =iframeIDname =iframeIDsrc =https://docs.google.com/viewerng/viewer?url=www.example.com&embedded=true>< / IFRAME>
    < / div>

    < script>
    函数reloadIFrame(){
    document.getElementById(ifm)。src = document.getElementById(iframeID)。src;
    }

    timerId = setInterval(reloadIFrame();,2000); ('load',function(){
    clearInterval(timerId);
    $(document).ready(function(){
    $('#iframeID')。
    console.log(Finally Loaded);
    });
    });
    < / script>


    UPDATE 2016-11-16 9:53am EST

    It appears many people are still seeing 204 responses even though Google has claimed to have "fixed" the problem. When I myself tested the loading of a document 50 times, 3 of those times Google returned a 204 response.

    Please visit this URL and post a comment of your unhappiness so that we can finally get Google to address and fix the issue once and for all: https://productforums.google.com/forum/?utm_medium=email&utm_source=footer#!msg/docs/hmj39HMDP1M/SR2UdRUdAQAJ

    UPDATE 2016-11-04 6:01pm EST

    It looks like the service is up and working again! Thanks to Google Docs for addressing the issue and answering my tweets. Hope it's working for all of you too.

    UPDATE 2016-11-04 3:33pm EST

    There was an update published to https://productforums.google.com/forum/#!msg/docs/hmj39HMDP1M/X6a8xJwLBQAJ which seems to indicate support for the service might be returning and/or there was an issue on their end which caused unintended results. Stay tuned. See comment immediately below:

    Original Post on Stack Overflow Starts Here

    Our web software used and relied on the Google Docs viewer service to embed documents into our website (via iframe) and to give our customers the ability to view docs without having to open separate applications (via visiting the URL). This functionality was provided by Google for quite some time and had worked perfectly!

    Example viewer URL:

    https://docs.google.com/viewer?url=http://www.pdf995.com/samples/pdf.pdf
    

    We began to notice, however, that files we were trying to load would only load very rarely. We initially thought there was an issue with their servers so began investigating the header responses we were getting. Particularly, we noted that nearly every request made was returning a 204 No Content response. Very occasionally we got a 200 response.

    Here's an example of one of the 204 responses we got:

    Here's an example of one of the 200 responses we got (very rare):

    After that I searched Google for 204 issues associated with the Google viewer service. I ended up on this page https://productforums.google.com/forum/#!msg/docs/hmj39HMDP1M/X6a8xJwLBQAJ which seems to indicate that Google has suddenly and abruptly discontinued the service. Here's a screenshot of that discussion (as of the time of this post).

    Given the fact that a Google "expert" replied to the person's similar inquiry; it seems that they've officially and totally abandoned support for the viewer service.

    My questions are the following:

    1. Does anyone else know for certain whether Google officially ended its support of the Google viewer service?

    2. Does anyone know of an updated similar Google product/service (perhaps Google Drive?) that allows a person to do the exact same thing as the viewer service referenced above? Ideally, I'd like a simple URL where I can reference an external document that doesn't have to exist on a Google server but can still reside on my server.

    3. What are some other comparable and free services you can suggest to allow me to embed documents such as Word docs, Excel docs, PowerPoint docs, and PDFs into a website that allows the user to view the documents within the browser without having to have those applications actually installed on their system.

    As a final note, I just want to say that for all the good Google does it's incredibly infuriating, frustrating, and annoying that they can offer a service that people rely on for a long time and suddenly pull the plug on it. I'm sure there are many others besides just myself that will never bother voicing concerns over that type of decision. Google corrected the issue and is still good in my book :-)

    Thanks ahead of time for your answers!

    解决方案

    I run a service that also relies on embedding the Google Doc Viewer and I have also encountered this issue. I could not find any other comparable service (free or otherwise).

    I have come up with a 'hack' that can help you get away with using the Google Doc Viewer. It does require JQuery though. What I do is keep refreshing the iframe every 2 seconds until it finally loads correctly. I also cover the iframe with a loading gif to hide the constant refreshing. My code:

    <style>
    .holds-the-iframe {
        background:url(/img/loading.gif) center center no-repeat;
    }
    </style>
    
    <div class="holds-the-iframe">
          <iframe id="iframeID" name="iframeID" src="https://docs.google.com/viewerng/viewer?url=www.example.com&embedded=true"></iframe>
    </div>
    
    <script>
    function reloadIFrame() {
        document.getElementById("ifm").src=document.getElementById("iframeID").src;
    }
    
    timerId = setInterval("reloadIFrame();", 2000);
    
    $( document ).ready(function() {
        $('#iframeID').on('load', function() {
            clearInterval(timerId);
            console.log("Finally Loaded");
        });
    });
    </script>
    

    这篇关于谷歌文档查看器返回204响应,不再工作,替代品?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆