If an empty array is specified within the data object passed to Upload the addFieldToFormData won't add anything to the resulting formData. There's cases where the server needs to know if the user for example wants to update an array in a db model, like emptying a tag array.
On the server side one can check if the receiving field was an empty array:
if(!fields['skills'][0]) { // empty array }
I'm not sure if there's a more simple or straightforward way of doing this, let me know you thoughts.
If an empty array is specified within the
data
object passed toUpload
theaddFieldToFormData
won't add anything to the resultingformData
. There's cases where the server needs to know if the user for example wants to update an array in a db model, like emptying a tag array.On the server side one can check if the receiving field was an empty array:
if(!fields['skills'][0]) { // empty array }
I'm not sure if there's a more simple or straightforward way of doing this, let me know you thoughts.