'Save a fileobj into a number of chunks.
Returns a list of `FileBlobIndex` items.
>>> indexes = file.putfile(fileobj)'

def putfile(self, fileobj, blob_size=DEFAULT_BLOB_SIZE, commit=True):

    results = []
    offset = 0
    checksum = sha1('')
    while True:
        contents = fileobj.read(blob_size)
        if (not contents):
            break
        checksum.update(contents)
        blob_fileobj = ContentFile(contents)
        blob = FileBlob.from_file(blob_fileobj)
        results.append(FileBlobIndex.objects.create(file=self, blob=blob, offset=offset))
        offset += blob.size
    self.size = offset
    self.checksum = checksum.hexdigest()
    metrics.timing('filestore.file-size', offset)
    if commit:
        self.save()
    return results
