Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method for uploading multiple files simultaneously #2

Open
2 tasks done
Adri-Hdez opened this issue May 11, 2023 · 0 comments
Open
2 tasks done

Method for uploading multiple files simultaneously #2

Adri-Hdez opened this issue May 11, 2023 · 0 comments

Comments

@Adri-Hdez
Copy link

DriveUp version checks

  • I have checked this method doesn't exists on the latest version of Driveup.
  • I have checked that this issue has not already been reported.

Reproducible testing example

from Driveup.drive import Drive
from Driveup.features.auth import authorize

# Global variables
TESTS_DIR = os.path.dirname(os.path.abspath(__file__)) 
SERVICE_SECRET_PATH = os.path.join(tests_dir,"__testsDataFiles","auth_testFiles","service_account_key.json")

UPLOAD_FILE_PATH_1 = os.path.join(tests_dir,"__testsDataFiles","drive_testFiles","test_file.csv")
UPLOAD_FILE_PATH_2 = os.path.join(tests_dir,"__testsDataFiles","drive_testFiles","test_file_test.csv")

DRIVE_FOLDER_ID_1 = 'https://drive.google.com/drive/folders/1wXpG03SN0RXI7y1QAd03IDGH2eXFD_VS'
DRIVE_FOLDER_ID_2 = 'https://drive.google.com/drive/folders/1w32Xx3SNCOF47y1QAs13IDFR8eXFD_VS'

# Method for uploading multiple files simultaneously
def test_multiple_upload(self):
      authorization = authorize(CLIENT_SECRET_PATH)
      drive = Drive(creds)
 
      files_paths = [UPLOAD_FILE_PATH_1, UPLOAD_FILE_PATH_2]
      folder_paths = [DRIVE_FOLDER_ID_1, DRIVE_FOLDER_ID_2]

      drive.upload(files_path, folder_paths)

Issue description

After testing the basic method of uploading a file to a specific directory on Google Drive, I have noticed that I can only upload files that are within a folder/directory. This forces me to upload the entire folder with all the files, and then move them out of the automatically created folder on Drive.

As an improvement and potential use for process automation, it would be beneficial to be able to upload multiple files simultaneously without having to place them within a folder. This would allow for better maneuverability with documents. As a proposed improvement to this method, it would be great to have the option to define different paths or IDs for each file.

An example of implementation or use case could be uploading three different files, such as a Google Doc, a Google Sheet, and a Google Presentation, and sending each to a different directory for storage based on file type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant