1. Stefan Seelmann
  2. djangoappengine

Commits

Waldemar Kornewald  committed 781bbc3

added range support to Blobstore backend. thanks to Sylvain Fourmanoit for the patch!

  • Participants
  • Parent commits 9579b0b
  • Branches default

Comments (0)

Files changed (1)

File storage.py

View file
  • Ignore whitespace
 from django.utils.encoding import smart_str, force_unicode
 
 from google.appengine.ext.blobstore import BlobInfo, BlobKey, delete, \
-    create_upload_url, BLOB_KEY_HEADER
+    create_upload_url, BLOB_KEY_HEADER, BLOB_RANGE_HEADER
 
 def prepare_upload(request, url, **kwargs):
     return create_upload_url(url), {}
                          "Google App Engine Blobstore.")
     response = HttpResponse(content_type=content_type)
     response[BLOB_KEY_HEADER] = str(blobkey)
+    response['Accept-Ranges'] = 'bytes'
+    http_range = request.META.get('HTTP_RANGE')
+    if http_range is not None:
+        response[BLOB_RANGE_HEADER] = http_range
     if save_as:
         response['Content-Disposition'] = smart_str(u'attachment; filename=%s' % save_as)
     if file.size is not None: