title: Meteor slingshot file upload to Google Cloud Storage internal server error
body: <p>I am trying to upload files using <a href="https://github.com/CulturalMe/meteor-slingshot" rel="nofollow">edgee:slingshot</a>, but I have several errors. I have did everything as described in github page. This is my settings on server:</p>
  
  <pre><code>Slingshot.GoogleCloud.directiveDefault.GoogleSecretKey = Assets.getText('google-cloud-service-key.pem');
  
  Slingshot.createDirective("myFileUploads", Slingshot.GoogleCloud, {
      bucket: 'dossum-app',
      GoogleAccessId: "GOOGXXXX",
      GoogleSecretKey: "qZEsLZ/NiXXXXXXXXXXXXUW8NVjSvRb8SgdxXXXXX2",
      acl: 'bucket-owner-full-control',
      authorize: function() {
          if (!this.userId) {
              var message = 'Please login before posting file';
              throw new Meteor.Error('Login Required', message);
          }
  
          return true;
      },
      key: function(file) {
          var user = Meteor.users.findOne(this.userId);
          return user.username + '/' + file.name;
      }
  });
  </code></pre>
  
  <p>And this is cors.json:</p>
  
  <pre><code>[{"origin": ["http://localhost:3000", "http://qnekt.zehinz.com"], "responseHeader": ["Origin", "Accept", "X-Requested-With", "Authorization", "Content-Type", "Content-Length", "Accept-Encoding", "X-CSRF-Token"], "method": ["GET", "HEAD", "DELETE", "PUT", "POST", "HEAD"], "maxAgeSeconds": 3600}]
  </code></pre>
  
  <p>If I run with above configuration I get this error without any details: <code>{error: 500, reason: "Internal server error"....</code>
  I have tried to comment this line:   <code>//GoogleSecretKey:"qZEsLZ/NiEkXo641XHIUW8NVjSvRb8SgdxIyYcV2"</code>
  This time I receive this error:</p>
  
  <pre><code>{error: "Forbidden - 403", reason: "Failed to upload file to cloud storage", details: undefined ...
  </code></pre>
  
  <p>Can anyone please guide me? </p>
  
  <ol>
  <li><p>Where should I get <strong>GoogleAccessId</strong> if I am using <strong>.pem</strong> file instead of <strong>GoogleSecretKey</strong>? </p></li>
  <li><p>What should be the cors.json file for file uploading and public reading?</p></li>
  </ol>