AJAX Call is not working - Function is not found

Hi guys,
I have a strange problem…
I have class ‘className’ and function ‘save’. When I am submitting a form, the save() function is called properly, but when I am trying to do the same via AJAX call, I am getting the following error:
OXID Logger.ERROR: ERROR_MESSAGE_SYSTEMCOMPONENT_FUNCTIONNOTFOUND save ["[object] (OxidEsales\Eshop\Core\Exception\SystemComponentException(code: 0): ERROR_MESSAGE_SYSTEMCOMPONENT_FUNCTIONNOTFOUND save at /var/www/html/oxid_project/vendor/oxid-esales/oxideshop-ce/source/Core/UtilsObject.php:231)\n[stacktrace]\n#0

The ajax is called via the ‘Choose File’ form, on change event and looks like this:

<form action="[{$oViewConf->getSelfActionLink()}]" method="post" role="form">
	<div id="uploadImageForm">
		[{$oViewConf->getHiddenSid()}]
		<input type="hidden" name="cl" value="className">
		<input type="hidden" name="fnc" value="save">
		<label for="myfile">Upload Image</label>
		<input type="file" id="image" name="editval[image]">
		<input type="submit" value="SUBMIT"/>
	</div>
</form>

The AJAX call can be found here: https://pastebin.com/ryAYeuq6
For some reason, I am not able to create a topic because the AJAX code is similar to other topics :frowning:

Is your class a regular frontend controller or an admin controller?

My class is a regular frontend controller.
And as I said above, it can be found and accessed via simple submit form…

That’s because submitting this forms sends a. Lot more data than your Ajax request. Try. Serializing the whole Form instead of just the file

I’ve added an id (#test) to the , and tried these both ways:
data: $("#test") and data: $("#test").serialize() but still the same error ‘ERROR_MESSAGE_SYSTEMCOMPONENT_FUNCTIONNOTFOUND’ is thrown…
Maybe because the JQuery is called on change event of ‘Choose File’ button I have to do something different?

Maybe this helps: