title: Gmail API - sending large attachments using php client library
body: <p>I am using AngularJs front-end and PHP backend, utilizing the Gmail api client, to send and view emails. I am able to successfully send emails with attachments using the method shown <a href="https://stackoverflow.com/questions/26627755/send-mail-with-attachment-using-gmail-new-api-but-it-is-not-displayed-for-recei">here</a>. But I am getting an "Error 413: Request Entity Too Large" when the message size is over 5MB.</p>
  
  <p>I have looked at a <a href="https://stackoverflow.com/questions/29081343/gmail-api-php-client-library-how-do-you-send-large-attachments-using-the-php-c">question</a> that is identical to mine. The answer provided allows files to be uploaded to Google Drive. I am unsure on how to refer to the Google Drive files in associated email messages.</p>
  
  <p>According to documentation using Google Drive files as attachments is only necessary after the total size of the email exceeds 35MB.</p>
  
  <p>The document also states that emails with large attachments can be sent using the media /upload option. But I am not able to find a php client method that would allow me to do so.</p>
  
  <p>Summing up, I have 2 questions. How is the media /upload method used to send emails with large attachments. How can files on Google Drive be referred to in email messages?</p>