Download and upload files to Google Drive using GO

78 views
Skip to first unread message

Patrick Arminio

unread,
Apr 12, 2016, 7:21:45 AM4/12/16
to Google App Engine
Hi everyone,

I'm trying to download a file from an URL and upload it to Google drive using GO and Appengine
Unfortunately I'm getting an OutOfMemory error on appengine, is there anything I can do?

I know that you can't store a file on Appengine, so I was thinking if is there
a way to do it in memory or shall I use Google Cloud Storage?

Patrick

Nick (Cloud Platform Support)

unread,
Apr 12, 2016, 11:10:52 AM4/12/16
to Google App Engine
Hey Patrick,

It seems likely that attempting to fetch the full contents of the file into memory (via the URL Fetch response body) is causing the instance to run out of memory. You could try to break the download / upload of the file into chunks if the remote server can handle chunked downloads, or you could increase the App Engine instance class to be one with more memory. Finally, you could have a Compute Engine machine do the work of downloading to disk and uploading to the Drive API (using service account credentials), communicating with your App Engine app via requests or some other means to trigger this work.

I hope this has helped show some of the alternatives and the nature of the problem.

Regards,

Nick
Cloud Platform Community Support

Patrick Guido

unread,
Apr 25, 2016, 6:45:36 AM4/25/16
to Google App Engine
Sorry for the late reply,

yeah I think I'm probably asking too much to App Engine :)
So I'll try to use Compute Engine (or related) directly.

Thanks for the reply, was really helpful 

--
You received this message because you are subscribed to a topic in the Google Groups "Google App Engine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-appengine/wdDV8wfz2k4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/f1b3cb2e-1c5f-40e8-a2ff-df004240d8f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Patrick

Reply all
Reply to author
Forward
0 new messages