def _proxiedUploadChunk(self, upload, chunk):
        """
        Clients that do not support direct-to-S3 upload behavior will go through
        this method by sending the chunk as a multipart-encoded file parameter
        as they would with other assetstore types. Girder will send the data
        to S3 on behalf of the client.
        """
        bucket = self._getBucket()

        if upload['s3']['chunked']:
            if 'uploadId' in upload['s3']:
                mp = boto.s3.multipart.MultiPartUpload(bucket)
                mp.id = upload['s3']['uploadId']
                mp.key_name = upload['s3']['keyName']
            else:
                mp = bucket.initiate_multipart_upload(
                    upload['s3']['key'],
                    headers=self._getRequestHeaders(upload))
                upload['s3']['uploadId'] = mp.id
                upload['s3']['keyName'] = mp.key_name
                upload['s3']['partNumber'] = 0

            upload['s3']['partNumber'] += 1

            key = mp.upload_part_from_file(
                chunk, upload['s3']['partNumber'],
                headers=self._getRequestHeaders(upload))
            upload['received'] += key.size
        else:
            key = bucket.new_key(upload['s3']['key'])
            key.set_contents_from_file(chunk,
                                       headers=self._getRequestHeaders(upload))

            if key.size < upload['size']:
                bucket.delete_key(key)
                raise ValidationException('Uploads of this length must be sent '
                                          'in a single chunk.')

            upload['received'] = key.size

        return upload
dataset/ETHPy150Open girder/girder/girder/utility/s3_assetstore_adapter.py/S3AssetstoreAdapter._proxiedUploadChunk/original