Hi Guys i create a component to upload files and its working so far, but along with the data I'll like to pass some parameters too, for example
HTML
<div class="col-md-4">
<div class="container">
<div class="large-12 medium-12 small-12 cell">
<label>
Files
v-on:click="upload()">Submit</v-btn>
</div>
</div>
</div>
Script
import
axios.post('/api/upload', this.files)
.then(resuta);
}, error => {
console.error(error);
});
}
here (axios.post('/api/upload', this.files)) i would like to include email: this.profile.email
Because I'm adding this parameter to the file name on my backend
Controller
[HttpPost, DisableRequestSizeLimit]
public ActionResult UploadFile(string email)
{
var files = Request.Form.Files;
foreach (var file in files)
{
}
}
}
return Ok();
}
this.files? Also, yourfileChangemethod is missing its argument listprofilebe an array and have a.emailproperty? Where doesprofile.emailcome from and when / where is it assigned a value? Does that value ever change once it's assigned?