2016-08-21 59 views
0

我有一個彈弓配置,這是工作到S3,但我需要遷移谷歌存儲。我有這個流星彈弓谷歌存儲

Slingshot.GoogleCloud.directiveDefault.GoogleSecretKey = Assets.getText('google-cloud-service-key.pem'); 

Slingshot.fileRestrictions("myDefinedDirective", { 
    allowedFileTypes: [ "image/png", "image/jpeg", "image/gif" ], 
    maxSize: 1 * 1024 * 1024 
}); 

Slingshot.createDirective("myDefinedDirective", Slingshot.GoogleCloud, { 
    GoogleAccessId: "00b4903a97ce39dcfd2fdcd89772b588fdf77d22f74b0a5e57ea9553ce88d4d7", 
    bucket: "img_appengine", 
    acl: "public-read", 
    authorize: function() { 
     return true; 
    }, 
    key: function (file) { 
     var user = Meteor.users.findOne(this.userId); 
     return user.emails[0].address + "/" + file.name; 
    } 
}); 

我認爲,問題它在GoogleAccessId上,但我找不到這個值!

誤差

edgee_slingshot.js:390 POST https://img_appengine.storage.googleapis.com/ 403()轉移@ edgee_slingshot.js:390(匿名功能)@ edgee_slingshot.js:294(匿名功能)@ edgee_slingshot.js:325(匿名函數)@ dynamics_browser.js:51_maybeInvokeCallback @ livedata_connection.js:446receiveResult @ livedata_connection.js:466_livedata_result @ livedata_connection.js:1631onMessage @ livedata_connection.js:274(匿名函數)@stream_client_sockjs.js:172_each ._。forEach @ underscore .js:105self.socket.onmessage @stream_client_sockjs.js:171REventTarget.dispatchEvent @sockjs-0.3.4.js:87SockJS._dispatchMessage @sockjs-0.3.4.js:1072SockJS._didMessage @sockjs-0.3.4.js:1130that .ws.onmessage @ sockjs-0.3.4.js:1277 autoform-slingshot.coffee:143 errorClass {error:「 - 403」,原因:「無法將文件上傳到雲存儲」,詳細信息:undefined,消息:「無法將文件上傳到雲存儲[ - 403]」,errorType :「Meteor.Error」}詳細信息:undefinederror:「 - 403」errorType:「Meteor.Error」消息:「無法將文件上傳到雲存儲[ - 403]」原因:「無法將文件上傳到雲存儲」 (...)get stack:stack()arguments:nullcaller:nulllength:0name:「get stack」proto:()set stack:stack()proto:Error(anonymous function)@ autoform-slingshot.coffee :143(匿名函數)@ edgee_slingshot.js:369

回答

0

我相信你有錯誤的accessId。它應該看起來像電子郵件地址,位於服務帳戶密鑰

+0

的「管理服務帳戶」部分,謝謝!是工作! –