On the client side, I am sending the data like this:
Code: Select all
const formData = new FormData();
formData.append('sessHashId', sessHashId);
formData.append('fileName', fileName);
formData.append('__tipo', 'avatar'); // Custom parameter with double underscoreOn the server side, my code to retrieve the additional parameters is as follows:
Code: Select all
@SuppressWarnings("unchecked")
Map<String, String> httpParams = (Map<String, String>) event.getParameter(SFSEventParam.UPLOAD_HTTP_PARAMS);
trace("HTTP Params: " + (httpParams != null ? httpParams.toString() : "null"));However, the log outputs:
Code: Select all
HTTP Params:{}
This means that the additional parameters sent from the client are not being recognized server-side.
I would like to know how to correctly pass custom parameters with file uploads and have them properly recognized by SmartFoxServer.
Thanks in advance for any help!