Created
February 11, 2023 13:06
-
-
Save Xiryl/bd2012bac23ebce4e3da1e4caf7e2699 to your computer and use it in GitHub Desktop.
driveapimedium-github-5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (file in files) { | |
val gfile = com.google.api.services.drive.model.File() | |
val fileContent = FileContent("your_mime", file) | |
gfile.name = file.name | |
val parents: MutableList<String> = ArrayList(1) | |
parents.add("folder_id") // Here you need to get the parent folder id | |
gfile.parents = parents | |
drive.Files().create(gfile, fileContent).setFields("id").execute() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment