Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if mail.get_content_maintype() == 'multipart':
- for part in mail.walk():
- if part.get_content_maintype() == 'multipart':
- continue
- if part.get('Content-Disposition') is None:
- attachment = part.get_payload(decode=True)
- attachment = part.get_payload(decode=True)
- gd_file = self.gd_box.g_drive.CreateFile({'title': 'Hello.jpg',
- "parents": [{"kind": "drive#fileLink", "id": folder['id']}]})
- gd_file.GetContentFile(attachment)
- gd_file.Upload()
Add Comment
Please, Sign In to add comment