Tag: sdk

简单的WebApp – 通过HTML / AWS Javascript SDK将file upload到S3

我只是开始我的开发过程,需要一些build议,如何处理我正在工作的一个简单的应用程序。 我对现代Web开发没有很好的理解。 我期望实现的是通过浏览器表单/ html表单将video或图像上传到Amazon S3。 理想情况下,我想利用AWS node.js SDK,但保持我的前端尽可能基本(即引导页面+ html更改)我承认我可以做一个直接的http操作,但仍然想利用现在的SDK。 我有我的HTML,窗体和CSS创build(使用引导),但不明白如何将表单连接到一个node.js脚本授权/ PUT? 我甚至可以从表单中去,并将文件传递给脚本上传? 感谢您的任何意见! :d

获取Google Drive NodeJS客户端的上传进度?

我们从req = drive.files.insert获取请求对象后如何使用它查找file upload进度? 我通过多次调用req stringsearch它,但无济于事。 function uploadFile(){ var path = untildify("~/workspace/incomplete/aw.jpg"); var drive = google.drive('v2'); var req = drive.files.insert({ resource: { title: 'aw.jpg' }, media: { body: fs.createReadStream(path) }, auth: oauth2Client }, function(err, response) { if (err) console.log(err); // else // console.log(response); }); console.log(req); }

如何在使用服务帐户上传时修复Google云端硬盘的存储空间不足问题

如果您使用的是Google Apps for Work(也称为G-Suite),并通过云端硬盘API将file upload到Google云端硬盘,那么您最终会看到一条如下所示的错误消息: Error: The user's Drive storage quota has been exceeded. 阅读下面了解为什么发生这种情况,以及如何解决这个问题

无法获取谷歌驱动器的刷新令牌(谷歌API v2)

试图让我的应用程序访问谷歌驱动器的刷新令牌。 我执行指南中的所有步骤: https://developers.google.com/drive/web/quickstart/quickstart-nodejs 去URL > https://accounts.google.com/o/oauth2/auth?scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.file&respon > se_type=code&client_id=…&redirect_uri=http%3A%2F%2Fl > ocalhost&approval_prompt=force 把代码放在getTocket中,总是得到只包含access_token的响应, 不用refresh_token : { access_token: '…', token_type: 'Bearer', expires_in: 3600 } 可能是什么问题? 我使用客户端(clientId)来访问youtube API(v2),并且我得到了更新的令牌。 我试图创build另一个clientId,但仍然无法获得刷新令牌。 我试图使用刷新令牌,我用你的谷歌驱动器的API,但它似乎不工作。 =(

在Google文档的Google驱动器API中的files.list()和files.get()中缺lessexportLinks

当获得一个File资源 ,该文件是一个Google文档,该文件应该有一个exportLinks对象。 当我从我的NodeJs客户端做到这一点,我得到一个与许多领域的文件,但exportLinks丢失。 当我使用Try It! 在其文档中, exportLinks确实存在,对于同一个文件。 唯一明显的区别是,我的请求使用Authorization标题,而“尝试”部分似乎使用key查询参数。 exportLinks掉线? 更多细节: 我正在使用google-auth和googleapis来发出我的请求,而我所调用的其他API似乎正常工作。 还认为这是一个范围权限的事情,并尝试使用谷歌驱动器的最广泛的范围 – https://github.com/google/google-api-nodejs-client – 但这没有什么区别。

寻找node.js模块为不同的存储提供者提供统一的文件API

我使用Node.js来托pipe一个Web服务器。 服务器将与不同的第三方存储提供商进行通信,例如Box,Dropbox,Googledrive,amazon s3,skydrive,ftp服务器等。服务器将从文件下载或上传文件到存储提供商。 我正在使用OAuth模块来实施授权过程并获得auth_token和auth_secret。 OAuth模块统一了不同服务器的授权界面。 OAuth模块封装了oauth服务器的API,并提供了统一和友好的界面。 使用OAuth模块,我不需要在代码中调用oauth服务器的API。 这是相当不错的,并节省了我的工作很多。 从不同的存储提供商下载/上传文件时遇到一些困难。 我必须为每个存储服务器编写不同的实现。 比如调用APi把file upload到盒子,调用s3 API把file upload到s3等。不知是否有一些节点模块封装了存储提供者的所有API,就像授权API的OAuth模块一样工作。 下面的伪代码表示我期望这种模块的工作原理。 我想这个名字是'存储'。 var storage = require("storage"); // This is the storage library I'm looking for. var s3 = storage.s3(s3_aouth_token_and_secret); // The declaration for the s3_aouth_token_and_secret is omitted for simplification. var box = storage.box(box_aouth_token_and_secret); var dropbox = storage.dropbox(dropbox_aouth_token_and_secret); var local_file_name = "./report.docx"; […]

Google API,drive.files.list和仅返回子文件

我正在使用NodeJS中的' googleapis '库,我试图返回当前指定文件夹中的文件和文件夹列表,但是我发现drive.files.list返回用户已被授予读取权限的所有文件。 我的目标是能够下载给定文件夹下的文件夹结构,然后以有意义的方式被NodeJS应用程序使用。 我正在使用的代码如下所示: const fs = require('fs'); const google = require('googleapis'); const OAuth2 = google.auth.OAuth2; const key = require('./key.json'); const jwtClient = new google.auth.JWT( key.client_email, null, key.private_key, ['https://www.googleapis.com/auth/drive'], null ); const drive = google.drive({ version: 'v3', auth: jwtClient }); jwtClient.authorize(function (err, tokens) { if (err) { console.log(err); return; } // Make an authorized […]

在节点js环境和serverUrl中parsingJavascript SDK

我正在尝试在node.js环境中使用parsingJavascript SDK,我完全困惑于为什么我无法得到这个工作。 我在Swift iOS应用程序中使用Parse,所以我熟悉Parse客户端代码。 这是我想要做的: var Parse = require('parse/node'); function ParseModule() { var self = this; self.initialize = function () { return new Promise(function(resolve, reject) { Parse.initialize("myAppID", "myJavascriptKey", "myMasterKey"); Parse.serverUrl = "https://myserver.com/parse"; Parse.Cloud.useMasterKey(); var query = new Parse.Query("MyClassName"); query.find() .then( function(results) { console.log("yay! it worked"); resolve(); } ).catch( function(err) { output.log("parse error: " + err); […]

谷歌驱动器file.update与双腿oauth返回好,但不能按预期工作

我有一个在console.developers.google.com中创build的服务帐户,并且我已经在高级设置>身份validation>pipe理OAuth客户端访问权下,将我所说的服务的客户端ID添加到我的全域代表团的admin.google.com中。 使用Google Nodejs api客户端和Google Nodejs auth库 ,我创build了一个jwt客户端,使用: const jwtClient = new google.auth.JWT( key.client_email, null, key.private_key, [ 'https://www.googleapis.com/auth/spreadsheets', 'https://www.googleapis.com/auth/drive', 'https://www.googleapis.com/auth/drive.file', 'https://www.googleapis.com/auth/drive.appdata', 'https://www.googleapis.com/auth/drive.scripts', 'https://www.googleapis.com/auth/drive.metadata' ], 'user@domain.com' ); 与 const google = require('googleapis'); const sheets = google.sheets('v4'); const drive = google.drive('v3'); 我跑了 async.waterfall( [ (callback) => { sheets.spreadsheets.create( { auth: jwtClient, resource: { properties: { title: 'Testing' } […]

Google云端硬盘API服务帐户域内

我必须使用Node.js服务器从Drive上的文件夹下载/上传/删除文件。 该文件夹位于公司的G Suite中,公司中只有less数人可以访问。 我必须使用服务帐户来执行此操作,问题是:是否有可能? 我怎样才能做到这一点? 我已经阅读https://developers.google.com/drive/v2/web/delegation和https://developers.google.com/identity/protocols/OAuth2ServiceAccount,但我不知道是否有可能授予服务帐户访问公司的域内的文件夹,因为服务帐户是@ developer.gserviceaccount.com和公司的域名是其他,所以当我尝试将该服务帐户添加到该文件夹​​时给我一个错误。 如果你能指导我,我会非常感激。 谢谢!