Upload and download files to Google Drive by using Quasar v1 and NodeJS API.
- Quasar v1
- Vuex
- Axios
- NodeJS Express
- Google APIs
- OAuth2
To be able to connect with Google Drive, the NodeJS API must have a credentials file with all the permissions needed by your account.
- Acess this link and click on "ENABLE THE DRIVE API":
- If this window appears, give a name to your project, agree with the terms and services and click on "NEXT":
- Note the Cliend ID and Client Secret for your own knowledge and then click on "DOWNLOAD CLIENT CONFIGURATION" to download the "credentials.json" file:
- Put the "credentials.json" file inside the "node" folder:
- Open the terminal and download the packages:
npm install
- Run the server:
node .
- Copy the long URL displayed on the terminal:
- Paste it on a browser tab and access the google account page:
- If a warning screen appears, click on these links to proceed:
- Give all the permissions needed by the Quickstart app to your Google Drive account.
- Confirm all the permissions again:
- Finally, copy the code and paste it on the terminal:
- The "token.json" file will be created inside the "node" folder:
- Stop the server and run it again. The last 10 files uploaded to your Google Drive will be listed, showing that the connection is working correctly:
- Open the terminal inside the "quasar" folder and download the packages:
npm install
- Run the app:
quasar dev
- At the main screen, press the "Upload File" button:
- Choose a file from your computer and press on "Upload" button:
- If a positive message has appeared, go back to the main screen and click on "List Files" button. Your file should be on the top of the list. It only shows the last 10 uploaded files.
- If you click on any file, you will be able to download it.