file-uploadgoogle-drive-apigoogle-drive-shared-driveflysystem-google-drivegoogle-drive-picker

upload files to any user's google drive after they authenticate


I want to upload files from my server to my users's google drive storage, after they authenticate, the questions are:

  1. Is it possible to do that?

  2. Do I have to re-authenticate the user every time they like to upload a new file?

  3. Could I embed the uploaded MP4 files in my website? (using the html video source as the file's download link of the user's google drive account)

  4. do I need to re-authenticate the user if they just want to see the embedded videos some time later, in other words, is there anyway I could save some sort of a Token so they don't keep doing that.


Solution

  • Is it possible to do that?

    Yes

    Do I have to re-authenticate the user every time they like to upload a new file?

    No, store a refresh token for the user and they wont need to authenticate each time.

    Could I embed the uploaded MP4 files in my website? (using the html video source as the file's download link of the user's google drive account)

    I wouldn't recommend it google drive isn't really designed for hosting of files in this manner that and people would need access to the file to download it anyway, its a big can of worms.

    do I need to re-authenticate the user if they just want to see the embedded videos some time later, in other words, is there anyway I could save some sort of a Token so they don't keep doing that.

    Yes as mentioned if the files are uploaded to your drive account you own them. You would need to share the files with anyone that you want to have access to them. You could set the files to public but thats not the best way to go about this.

    Reference