![]() When I don't specify the folder ID, a dummy file does get posted to my drive, but it doesn't upload the file I want, and it doesn't upload anything at all when I specifiy a folderID.Įssentially, I need help inserting a file that comes in to a specific folder in Google Drive. How if you would like to upload files into folder inside a folder Yes, again you would need the File ID You can use the ListFile to get the files but this. We used service.files().create() method to create a new folder, we passed the foldermetadata dictionary that has the type and the name of the folder. I have read the documentation and looked at other answer but I have not found a solution. I need help understanding what I am doing wrong. Files_to_send is a list with all the files that I need to upload to the specific folder, and config contains the folder path. Using the interface on the Drive API documentation, I am able to get data with the same folderID but I am not able to post (Even with the interface). Status = ('' + str(path_id) + "/children") def post_file(self, files_to_send, config = ):įilename = file_to_('/') I get the folderID and I try to post a file to the folder however I get a 404 Not Found error. The output of the above code: test.txt file is created in google drive.So I am in the process of trying to upload a file to a specific Google Drive folder that a user specifies. # Set content of the file from the given string. ![]() Step 3 : Upload files to your Google Drive You can customize the behavior of OAuth2 in one settings file settings.yaml Get Closer To Your Dream of Becoming a Data Scientist with 70+ Solved End-to-End ML Projects Step 1: Import the librariesįollow the steps to Get Authentication for Google Service API in the below link: Get Authentication for Google Service APIĭownload client_secrets.json from Google API Console and OAuth2.0 is done in two lines. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |