Getting NotImplementedError when trying to send a file to a generic worker

I am trying to send an uploaded file to the worker, but I keep getting the following error:

2023-04-28 08:59:53.969 ERROR : Exception is raised
Traceback (most recent call last):
File “viktor_connector\connector.pyx”, line 295, in connector.Job.execute
File “viktor\core.pyx”, line 1920, in viktor.core._handle_job
File “viktor\core.pyx”, line 1905, in viktor.core._handle_job._handle_view
File “viktor\views.pyx”, line 1927, in viktor.views.View._wrapper
File “D:\viktor\EnergyAnalysis\”, line 28, in displacement_plot
File “viktor\external\external_program.pyx”, line 335, in viktor.external.external_program.ExternalProgram.execute
File “viktor\external\external_program.pyx”, line 337, in viktor.external.external_program.ExternalProgram.execute
File “viktor\external\generic.pyx”, line 81, in viktor.external.generic.GenericAnalysis._write_job_content

The code is:

def displacement_plot(self, params, **kwargs):
        building = params.building
        # Generate the input file(s)
        files = [
            ('building.txt', building)
            #('input2.txt', file2)

        # Run the analysis and obtain the output file.
        generic_analysis = GenericAnalysis(files=files, executable_key="countdown", output_filenames=["figure.json"])
        output_file = generic_analysis.get_output_file("figure.json")
        figure =, output_type='Figure', skip_invalid=False, engine=None)
        return PlotlyResult(figure.to_json())

What am I doing wrong? How do you pass a file that has been uploaded to the web app? Thanks


As you can see in the documentation here, the files should be of type BytesIO or File. If you check the type of params.building by using


You will see it is of type FileRessource. To acces the File object for your analysis, you can use

building = params.building.file

kind regards,


Perfect! That solved it! Thank you!