create_drive_file
Create and store new files in Google Drive or shared drives with specified content or by fetching from a URL. Requires user email, file name, and optional folder ID, MIME type, or content source.
Instructions
Creates a new file in Google Drive, supporting creation within shared drives. Accepts either direct content or a fileUrl to fetch the content from.
Args: user_google_email (str): The user's Google email address. Required. file_name (str): The name for the new file. content (Optional[str]): If provided, the content to write to the file. folder_id (str): The ID of the parent folder. Defaults to 'root'. For shared drives, this must be a folder ID within the shared drive. mime_type (str): The MIME type of the file. Defaults to 'text/plain'. fileUrl (Optional[str]): If provided, fetches the file content from this URL.
Returns: str: Confirmation message of the successful file creation with file link.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
content | No | ||
fileUrl | No | ||
file_name | Yes | ||
folder_id | No | root | |
mime_type | No | text/plain | |
user_google_email | Yes |