1

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 here. But I am getting an "Error 413: Request Entity Too Large" when the message size is over 5MB.

I have looked at a question 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.

According to documentation using Google Drive files as attachments is only necessary after the total size of the email exceeds 35MB.

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.

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?

kajan
  • 152
  • 1
  • 10
  • I suggest you look at the Google documentation on [multipart upload](https://developers.google.com/drive/v2/web/manage-uploads#multipart), they also have example on how to implement the method to your application. Good luck! – Andres Jan 23 '16 at 00:37
  • My issue is that I don't know how to make a POST request to "[gmail api](https://www.googleapis.com/upload/drive/v2/files?uploadType=media)". So far I have been using methods that are included in the gmail api client library. I had tried to make requests(testing with GET for simplicity) using curl, but I get a 401: Login required error. – kajan Jan 26 '16 at 18:07
  • Please provide examples of your code here without any further information I cannot help you here. To use the media/upload option from Drive API it is reference in the documentation from the link above. – Andres Jan 27 '16 at 18:50

0 Answers0