@method_decorator(get_file)
    def post(self, request):
        replace = 'replace' in request.POST

        file_ref = expose_cached_download(
            request.file.read(),
            file_extension=file_extention_from_filename(request.file.name),
            expiry=1*60*60,
        )

        # catch basic validation in the synchronous UI
        try:
            validate_file_format(file_ref.get_filename())
        except (FixtureUploadError, JSONReaderError, HeaderValueError) as e:
            messages.error(request, _(u'Upload unsuccessful: %s') % e)
            return HttpResponseRedirect(fixtures_home(self.domain))

        # hand off to async
        task = fixture_upload_async.delay(
            self.domain,
            file_ref.download_id,
            replace,
        )
        file_ref.set_task(task)
        return HttpResponseRedirect(
            reverse(
                FixtureUploadStatusView.urlname,
                args=[self.domain, file_ref.download_id]
            )
        )
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/fixtures/views.py/UploadItemLists.post/original