Google Gears 上传:奇怪的错误

发布于 2024-07-26 00:14:35 字数 2923 浏览 3 评论 0原文

我遇到了这个非常奇怪的错误,我不知道如何处理它。 我的设置是一个页面,我可以在其中选择一个图像文件(gears beta.desktop),然后应该上传。 但它没有上传,并给出了一个非常奇怪的错误,我无法摆脱。 下面是我的代码:

var filesToUpload = null;

        function progressEvent(event) {
            var bar = $("#progressBar");
            var percentage = Math.round((event.loaded / event.total) * 100);

            bar.width(percentage + '%');
        }

        function uploadState() {
            if(request.readyState == 4) {
                if(request.status != 200) {
                    alert('ERROR');
                } else {
                    alert('DONE');
                }
            }
        }

        function handleFiles(files) {
            if(files.length) {
                $('#loader').slideDown(500);
                var curFile = files[0];

                request.open('POST', 'upload.php');
                request.setRequestHeader("Content-Disposition", "attachment; filename=\"" + curFile.name + "\"");
                request.onreadystatechange = uploadState;
                request.upload.onprogress  = progressEvent;

                request.send(curFile.blob);
            }
        }

        init = function() {
            if(!window.google || !google.gears) {
                $('body').css('background', 'white');
                $('#gearsOn').hide();
                $('#gearsOff').show();
                return;
            }

            // verberg 'geen gears' bericht
            $('#gearsOff').hide();

            // init upload zooi (gears)
            desktop = google.gears.factory.create('beta.desktop');
            request = google.gears.factory.create('beta.httprequest');


            // on click funct
            $('#titel').click(function() {
                var newtitle = prompt("Voer een titel in voor het album.");

                if(newtitle != '' && newtitle != null) {
                    $(this).text(newtitle);
                }
            });

            $('.addPictures').click(function() {
                filesToUpload = null;
                var options = { singleFile: true, filter: [ 'image/jpeg', 'image/png'] };
                desktop.openFiles(handleFiles, options);
            });
        };

        $(document).ready(init);

它给出了以下错误:

[Exception... "Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsILoadGroup.groupObserver]" nsresult: "0x80004001 (NS_ERROR_NOT_IMPLEMENTED)" location: "JS frame :: file:///Users/Fabian/Library/Application%20Support/Firefox/Profiles/oo132cjy.default/extensions/%7Be3f6c2cc-d8db-498c-af6c-499fb211db97%7D/components/componentCollectorService.js :: anonymous :: line 1155" data: no]
[Break on this error] obj = getIface(request.loadGroup.groupObserver);

该东西在此位置可见: Dynamics照片

提前致谢!

I've got this very strange error and I don't know how to deal with it.
My setup is a page in which I can select one image file, (gears beta.desktop) and then it should upload. But it doesn't upload, and gives a very strange error which I can't get away. below is my code:

var filesToUpload = null;

        function progressEvent(event) {
            var bar = $("#progressBar");
            var percentage = Math.round((event.loaded / event.total) * 100);

            bar.width(percentage + '%');
        }

        function uploadState() {
            if(request.readyState == 4) {
                if(request.status != 200) {
                    alert('ERROR');
                } else {
                    alert('DONE');
                }
            }
        }

        function handleFiles(files) {
            if(files.length) {
                $('#loader').slideDown(500);
                var curFile = files[0];

                request.open('POST', 'upload.php');
                request.setRequestHeader("Content-Disposition", "attachment; filename=\"" + curFile.name + "\"");
                request.onreadystatechange = uploadState;
                request.upload.onprogress  = progressEvent;

                request.send(curFile.blob);
            }
        }

        init = function() {
            if(!window.google || !google.gears) {
                $('body').css('background', 'white');
                $('#gearsOn').hide();
                $('#gearsOff').show();
                return;
            }

            // verberg 'geen gears' bericht
            $('#gearsOff').hide();

            // init upload zooi (gears)
            desktop = google.gears.factory.create('beta.desktop');
            request = google.gears.factory.create('beta.httprequest');


            // on click funct
            $('#titel').click(function() {
                var newtitle = prompt("Voer een titel in voor het album.");

                if(newtitle != '' && newtitle != null) {
                    $(this).text(newtitle);
                }
            });

            $('.addPictures').click(function() {
                filesToUpload = null;
                var options = { singleFile: true, filter: [ 'image/jpeg', 'image/png'] };
                desktop.openFiles(handleFiles, options);
            });
        };

        $(document).ready(init);

It gives the following error:

[Exception... "Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsILoadGroup.groupObserver]" nsresult: "0x80004001 (NS_ERROR_NOT_IMPLEMENTED)" location: "JS frame :: file:///Users/Fabian/Library/Application%20Support/Firefox/Profiles/oo132cjy.default/extensions/%7Be3f6c2cc-d8db-498c-af6c-499fb211db97%7D/components/componentCollectorService.js :: anonymous :: line 1155" data: no]
[Break on this error] obj = getIface(request.loadGroup.groupObserver);

The thing is visible at this location: Dynamics Photo

Thanks in advance!!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

暗恋未遂 2024-08-02 00:14:35

当我使用 page speed - firebug 扩展时,出现此错误。 如果您使用相同的尝试停用此扩展。

I get this error when I'm using page speed - extension to firebug. If you use the same try to deactivate this extension.

源来凯始玺欢你 2024-08-02 00:14:35

禁用页面速度没有帮助...所以卸载了扩展..并且它可以工作

disabling page speed did not helped... so uninstalled the extension.. and it works

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文