wahengchang / googleStorageUploadNodejs

It is an example of uplaod a local file to google storage in Nodejs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

googleStorageUploadNodejs

It is a project of uploading file to google storage by

  1. -html form multipart

  2. -angularjs upload directive, controller and $http.post

  3. Visit the Google Developer Console

  4. Click credentials

  5. Create new client ID

  6. Create a service account, then generate new JSON key and download the JSON key file. ⋅⋅* Put the JSON key in the root folder, as showed of google_key.json

  7. npm install

//index.js replace your keyFilename and projectId

var storage = gcloud.storage({
  keyFilename: 'google_key.json',
  projectId: 'projectId'
});
  1. npm start
  2. localhost:5000/upload
  3. localhost:5000/angularupload
//result when upload success

{
code: 0,
downloadlink: "https://storage.googleapis.com/bucket/upload.file"
}

Google offical tutorial

Gogole storage nodejs Example

Angularjs Multipart Example by Jenny Louthan

About

It is an example of uplaod a local file to google storage in Nodejs


Languages

Language:JavaScript 66.3%Language:HTML 33.7%