如何在浏览器中使用一个驱动器文件选择器? [英] How to use one drive file picker in browser?

查看:97
本文介绍了如何在浏览器中使用一个驱动器文件选择器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在我的网站中集成一个驱动程序文件选择器.我正在使用此js库来完成任务.

I need to integrate One Driver file picker in my website. I am using this js lib to do the task.

<script type="text/javascript" src="//js.live.net/v5.0/wl.js"></script>

我写的代码是

WL.init({ client_id: "000000004C1xxxxx", redirect_uri: 'https://xxx.net/' });
WL.login({
        scope: "wl.skydrive wl.signin"
    }).then(
        function(response) {
            WL.fileDialog({
                mode: "open",
                select: "multi"
            }).then(
                function (response) {
                },
                function (responseFailed) {
                }
            );
        },

        function(response) {
            log("Failed to authenticate.");
        }
    );

它显示了弹出窗口,并经过了验证过程.但是,一旦我在弹出窗口中登录.它只是重定向到我提供的重定向URL,文件选择器从未显示过.有什么想法吗?

It showed the popup window, and went through the authentication process. However once I've logged in within the popup window. It just redirected to the redirect URL I provided, the file picker never showed. Any ideas?

推荐答案

我通过在回调页面中包含js脚本解决了这个问题,wl sdk将自动为您处理oauth进程.

I solved this issue by including the js script in my callback page, wl sdk will automatically handle the oauth process for you.

<script type="text/javascript" src="//js.live.net/v5.0/wl.js"></script>

这很奇怪,因为我找不到与MS开发者网站上的回调页相关的任何文档.

It's weird as I could not find any documents related to how you should do with your callback page on MS developer website.

这篇关于如何在浏览器中使用一个驱动器文件选择器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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