Skip to content

Commit

Permalink
changed mimeType in uplod_file func in google_drive_tool to mimetypes…
Browse files Browse the repository at this point in the history
….guess_type
  • Loading branch information
rclarke0 committed Apr 3, 2024
1 parent ac5f91b commit 6b54208
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions abr-testing/abr_testing/automation/google_drive_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
from typing import Set, Any, Optional
import webbrowser
import mimetypes
from oauth2client.service_account import ServiceAccountCredentials # type: ignore[import]
from googleapiclient.discovery import build
from googleapiclient.http import MediaFileUpload
Expand Down Expand Up @@ -74,10 +75,9 @@ def upload_file(self, file_path: str) -> str:
"""Upload file to Google Drive."""
file_metadata = {
"name": os.path.basename(file_path),
"mimeType": "application/json",
"mimeType": str(mimetypes.guess_type(file_path)[0]),
"parents": [self.parent_folder],
}

media = MediaFileUpload(file_path, resumable=True)

uploaded_file = (
Expand Down

0 comments on commit 6b54208

Please sign in to comment.