Looking to store the path of a file in a variable when uploading:
<input type="file" fromControlName="file" />
This is just one field among many in a form, and I need to upload it along with other data.
storeSubjects(subject : Subjects){
let url = 'http://api.azharcouncil.com/api/subjects/PostSubject?code='+subject.code+'&Type_ID='+subject.kindOfSub+'&Faculty_Id='+subject.name+
'&Main_Tittle='+subject.mainTitle+'&Child_Tittle='+subject.subTitle+'&Description='+subject.description+'&Notes='+subject.notes+'&Subject_Path='+subject.file;
let headers = new Headers({ 'Content-Type': 'text/plain' });
let options = new RequestOptions({ headers: headers });
return this.http.post(url, JSON.stringify(subject), options);
}
I specifically need to include &Subject_Path=(path of file) in the request.