:reference https://dev.twitter.com/rest/reference/post/media/upload-chunked
            :allowed_param:

def upload_chunked(self, filename, *args, **kwargs):
        """ :reference https://dev.twitter.com/rest/reference/post/media/upload-chunked
            :allowed_param:
        """
        f = kwargs.pop('file', None)

        # Media category is dependant on whether media is attached to a tweet
        # or to a direct message. Assume tweet by default.
        is_direct_message = kwargs.pop('is_direct_message', False)

        # Initialize upload (Twitter cannot handle videos > 15 MB)
        headers, post_data, fp = API._chunk_media('init', filename, self.max_size_chunked, form_field='media', f=f, is_direct_message=is_direct_message)
        kwargs.update({'headers': headers, 'post_data': post_data})

        # Send the INIT request
        media_info = bind_api(
            api=self,
            path='/media/upload.json',
            method='POST',
            payload_type='media',
            allowed_param=[],
            require_auth=True,
            upload_api=True
        )(*args, **kwargs)

        # If a media ID has been generated, we can send the file
        if media_info.media_id:
            # default chunk size is 1MB, can be overridden with keyword argument.
            # minimum chunk size is 16K, which keeps the maximum number of chunks under 999
            chunk_size = kwargs.pop('chunk_size', 1024 * 1024)
            chunk_size = max(chunk_size, 16 * 2014)

            fsize = getfilesize(filename, f)
            nloops = int(fsize / chunk_size) + (1 if fsize % chunk_size > 0 else 0)
            for i in range(nloops):
                headers, post_data, fp = API._chunk_media('append', filename, self.max_size_chunked, chunk_size=chunk_size, f=fp, media_id=media_info.media_id, segment_index=i, is_direct_message=is_direct_message)
                kwargs.update({ 'headers': headers, 'post_data': post_data, 'parser': RawParser() })
                # The APPEND command returns an empty response body
                bind_api(
                    api=self,
                    path='/media/upload.json',
                    method='POST',
                    payload_type='media',
                    allowed_param=[],
                    require_auth=True,
                    upload_api=True
                )(*args, **kwargs)
            # When all chunks have been sent, we can finalize.
            headers, post_data, fp = API._chunk_media('finalize', filename, self.max_size_chunked, media_id=media_info.media_id, is_direct_message=is_direct_message)
            kwargs = {'headers': headers, 'post_data': post_data}

            # The FINALIZE command returns media information
            return bind_api(
                api=self,
                path='/media/upload.json',
                method='POST',
                payload_type='media',
                allowed_param=[],
                require_auth=True,
                upload_api=True
            )(*args, **kwargs)
        else:
            return media_info