You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to send a file with these modification but received an empty array [] from the controller with dd(). Could anybody can show me the way to do it.
/**
* Fetch all relevant data for the form.
*/
data() {
let data = new FormData();
for (let property in this.originalData) {
this.appendData(property,this[property],data);
}
return data;
}
appendData(key,value,appendTo){
if (value instanceof Array){
for (const i of value.keys() ){
this.appendData(`${key}[${i}]`,value[i],appendTo)
}
}
else if (typeof value === "object"
&& value !== null
&& !(value instanceof File))
{
for (const k in value) {
if (value.hasOwnProperty(k)) {
this.appendData(`${key}[${k}]`,value[k],appendTo);
}
}
}
else {
appendTo.append(key,value)
}
}
I am trying to send a file with these modification but received an empty array
[]
from the controller withdd()
. Could anybody can show me the way to do it.Form.js
ExampleComponent.vue
The text was updated successfully, but these errors were encountered: