Here's the challange: I want to create a structure of folders in my drive when I begin a new proyect, I want to do it using JS (what according to google is possible), but when I try to see the instructions I get lost. I've already got my client ID and my API Key. I could also to authenticate and see my drive structure, but I can't find the code for creating the folders ¿Could someone please help me on this? Thanks on advance...
2 Answers
You need to use create file endpoint like it is written in this page: https://developers.google.com/drive/api/v3/folder#create_a_folder
6 Comments
Fernando De Palma Madrid
I have used the code listed in this link. To refer to the drive object I replaced "drive.files.create" with "gapi.client.drive.files.create" to solve the problem "drive is not defined" but then, I don't receive any log message, nor success nor error...
Marek Szkudelski
@FernandoDePalmaMadrid, please update your question with actual code you've written and errors you've got
Fernando De Palma Madrid
Here's the complete code. All the processes work fine (Login, list of folders), but the "create" option doesn't work. It does not send anything to the log console. drive.google.com/open?id=1EdJgAPBt-sc9Li6ui_Pmvss32tf1FMqD
Marek Szkudelski
@FernandoDePalmaMadrid, paste function you use to creating folders to your question (you can edit it). It will be better formatted than plain text. Read also that topic: stackoverflow.com/help/how-to-ask
Fernando De Palma Madrid
The code (just for the function itself) is 133 longer than permited...
|
Finally I found the solution in another post: https://stackoverflow.com/a/44527113/11971139
Thanks to Uri and all the people around here that adds (not the others :)!