I have a set of .mp3 files which is download from a website and store it in a local drive (Say D:)
These files are renamed based on Date of the recording (format: YYYY_MM_DD)
Now i need to upload these files to Google Drive using Service Account key.
All this is working fine.
but my problem is there is a condition:
- Check if a folder by name “YYYY” exists. if not, then create a folder
- In Folder “YYYY”, check if folder “MM” exists. if not, create a folder with name as MM
- In Folder “MM”, check if folder “DD” exists. if exists, then upload the file into that folder, else create a folder “DD” and then upload.
While Steps 1, 2, 3 are working fine.
but each time it uploads, it once again creates a new folder and subfolders.
So Basically, it is not checking if “Path Exists” where i am checking for Folder’s existence.
Can someone help please!