Hello Everyone,
I am developing a custom app and have created a module to upload invoices. The file input field is of type file, and I selected the type collection with data (buffer) and filename. However, when I test the module, I encounter the following error:
[500] Call to a member function getName() on null
I have double-checked the configuration and ensured that the input data is being passed as a collection containing both data and filename. Despite this, the error persists.
I don’t think you are supposed to add both the filename and buffer parameter within a collection parameter, especially not with the spec directive. Maybe this results in the getName() function throwing an error, as the filename value cannot be accessed (which explains why it is null)
As far as I can see, there is no need to nest it either. So try to use the filename and data parameters in the top level object.
Hello @Terry_Hopper,
Thank you for your suggestion.
I added this ligne “type”: “multipart/form-data”, yesterday but the error didn’t change.
I don’t know if it’s related to the fact that the endpoint is expecting a file and not the name and data separated ? but I don’t know how to proceed
system
This topic was automatically closed because it's resolved or inactive. Please, start a new topic.
6
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.