Guest User

Untitled

a guest
Jan 21st, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. if mail.get_content_maintype() == 'multipart':
  2.  
  3. for part in mail.walk():
  4. if part.get_content_maintype() == 'multipart':
  5. continue
  6.  
  7. if part.get('Content-Disposition') is None:
  8.  
  9. attachment = part.get_payload(decode=True)
  10.  
  11. attachment = part.get_payload(decode=True)
  12. gd_file = self.gd_box.g_drive.CreateFile({'title': 'Hello.jpg',
  13. "parents": [{"kind": "drive#fileLink", "id": folder['id']}]})
  14. gd_file.GetContentFile(attachment)
  15. gd_file.Upload()
Add Comment
Please, Sign In to add comment