How to upload file > 15GB to Google Service Account - javascript

I am trying to upload a file > 15GB to a google service account, using this snippet from Google Drive:
http://gsuitedevs.github.io/drive-utils/
https://github.com/gsuitedevs/drive-utils/tree/master/upload
Is there a way to upload files larger than 15GB here? Or, a way to modify it so that it will upload to my personal Google Drive (where I'm paying for storage) instead of a service account that has that limitation? If so, how would I do so?

There are a file storage limit on Google drive Upload files to Google Drive
Google Apps Free edition (legacy) Individual consumer accounts 15 GB
If you do an about.get you will see how much space the service account has access to. Service accounts are basic users and there is no way that i know of to give it more space.
Granting it access to your account
You can take the service account email address and share a folder on your google drive account with the service account. It will then have access to upload to that folder.

Related

is this possible with google authorization

I have an organization in my application and i want to link an google drive to that organization, so that users can upload directly to that google drive.
So flow:
Admin authorizes google drive (adds people (access) on google drive itself
User (who is added to that google drive) wants to upload something from my application
User authorizes their account and uploads their content. This gets uploaded in the drive of the admin
Are there any docs about this or where do i look? Can't seem to find anything related, so it may not be possible.

Google drive and Firebase Google auth info ionic

I have an app with google auth configured with firebase. can I use the token generated by firebase to access google drive documents?
I want the user logged in inside the app with Gmail auth to be able to read a document on Google drive that is shared with him.
I can't find anything online about this case.
I tried to open the document inside a webview but ask me to login to google drive
you have to follow these steps in order to make Google Sign-In and access to drive work.
Go to your credentials
Choose OAuth consent screen
Fill all the required details
Choose OAuth client id
Fill all the required details and For SHA1 key use this ‘keytool -exportcert -keystore ~/.android/debug.keystore -list -v’
Copy Client Id & use as reverse client id
NOTE image Android
Good Example
https://www.jellyfishtechnologies.com/blog/implement-google-drive-api-ionic-2/

Can users upload files directly to Google Cloud Storage without authentication?

I just set up a simple JS photo uploader on my site. It uploads photos directly to a Google Cloud Storage bucket.
I used the code from their official JavaScript library
But if you look at that code, you'll see that it requires authentication. I'm authenticated and able to upload photos, but I want everyone to be able to just upload their files without signing in to their Google Accounts.
Is that possible?
You could use a POST policy doc: https://cloud.google.com/storage/docs/xml-api/post-object#policydocument
This will let you build a signed request with various constraints built in (content-length, content-size, etc.), allowing unauthenticated users to upload to your bucket with the given constraints.

Google Drive API Public download private account files

I've been searching a while and I can't figure this out.
I need to know if it possible and how to create an web app to allow someone to download a certain file (introducing on First and Last Name) stored on a Google drive Account. The issue is that this files has to be private in Drive.
Is this possible? If it is based on PHP, Javascript or jQuery better.
I know that I need Google Drive API, but which certificates should I use?
Thank you very much!
The Google Drive API uses OAuth2 for authorization. Most apps have the user go through the OAuth2 flow, so that app can access files in their Drive. If instead you want the users to download private files from your Drive, you can go through the OAuth2 flow once and then store the credentials so that they can be used for all users.

Upload file to my google drive from anyone using javascript

I am new to google api. I am able to do this file upload from app script and any file which is uploaded through that script get stored to my drive only.
But how to do this using javascript.
Example on google : https://developers.google.com/drive/web/quickstart/quickstart-js
shows how to do this but file gets uploaded to the same user's drive who is authorizing the app. How to restrict it to my drive only.
Thanks
Simple answer is you cant with JavaScript. The reason being is that JavaScript works with OAuth2 this requires that you ask the user permission to access your data.
If you want to have it access your drive account you would have to save the refreshtoken some place and then send that when ever the script was loaded. JavaScript is client sided so anyone that checked the code on the page would then have all the information they needed to do what ever they wanted with your drive account. Security wise that's a bad idea.
I recommend you look into using a server sided scripting language like PHP. You might want to consider a service account. Note: everything will be owned by the service account so you will either have to give the Service account access to your Google Drive files or you will need to move your drive files to the Service account.
If you don't want the service account to have the files you could go with normal Oauth2 save the refresh token and then store it in the server sided code there wont be as much of security risk there.

Categories

Resources