@csrf_exempt
    def post(self, request, container, object_name):
        form = UploadObjectForm(request.POST, request.FILES)
        if not form.is_valid():
            raise rest_utils.AjaxError(500, 'Invalid request')

        data = form.clean()

        try:
            if object_name[-1] == '/':
                result = api.swift.swift_create_pseudo_folder(
                    request,
                    container,
                    object_name
                )
            else:
                result = api.swift.swift_upload_object(
                    request,
                    container,
                    object_name,
                    data['file']
                )
        except exceptions.AlreadyExists as e:
            # 409 Conflict
            return rest_utils.JSONResponse(str(e), 409)

        return rest_utils.CreatedResponse(
            u'/api/swift/containers/%s/object/%s' % (container, result.name)
        )
Create a new object or pseudo-folder
dataset/ETHPy150Open openstack/horizon/openstack_dashboard/api/rest/swift.py/Object.post