0

I have some big files stored on Google Storage. I would like users to be able to download them only when they are authenticated to my GAE application. The user would use a link of my GAE such as http://myapp.appspot.com/files/hugefile.bin

My first try works for files which sizes are < 32mb. Using the Google Storage experimental API, I could read the file first then serve it to the user. It required my GAE application to be a team member of the project which Google Storage was enabled. Unfortunately this doesn’t work for large files, and it hogs bandwidth by first downloading the file to GAE and then serving it to the player.

Does anyone have an idea on how to carry out that?

qdii
  • 12,505
  • 10
  • 59
  • 116

2 Answers2

1

You can store files up to 5GB in size using the Blobstore API: http://code.google.com/appengine/docs/python/blobstore/overview.html

Here's the Stackoverflow thread on this: Upload file bigger than 40MB to Google App Engine?

One thing to note, is reading blobstore can only be done in 32MB increments, but the API provides ways to accessing portions of the file for reads: http://code.google.com/appengine/docs/python/blobstore/overview.html#Serving_a_Blob

Community
  • 1
  • 1
Sologoub
  • 5,312
  • 6
  • 37
  • 65
  • sorry, this is a good solution in most cases, but in my case Google Cloud Storage is not an option. – qdii Feb 17 '12 at 21:26
  • Sorry, not really sure what you mean - Google Cloud Storage and Blobstore API seem to be two different things. – Sologoub Feb 19 '12 at 07:05
  • This is what I meant, let me rephrase this :) You suggested using Blobstore, and I meant that I couldn’t, because in my case, I’m forced to store my files on Google Cloud Storage :) – qdii Feb 19 '12 at 22:44
  • Got it, thanks for clarification. Looking over the documentation, it seems that GCS provides the APIs to set access control ahead of time and is able to authenticate either through OAUTH or google accounts. Is the limitation you are running into that your GAE app needs to read through the actual file? If you don't need to manipulate the file, you should be sending the user to GSC resource and not trying to get the file into GAE first. – Sologoub Feb 24 '12 at 15:52
1

FYI in the upcoming 1.6.4 release of AppEngine we've added the ability to pass a Google Storage object name to the blobstore.send_blob() to send Google Storage files of any size from you AppEngine application.

Here is the pre-release announcement for 1.6.4.

Stuart Langley
  • 7,044
  • 1
  • 20
  • 20