when I\'m trying to install \"npm install ng2-file-upload --save\" in my angular 4 application it throws
UNMET PEER DEPENDENCY @4.1.0
UNMET PEER DEPENDENCY
import fileupload from primeng or use simple file uploader
HTML
TS
var data = new FormData();
let index: number = 0;
if (this.files != undefined)
{
for (let file of this.files.files)
{
data.append("myFile" + index, file);
++index;
}
}
data.append('viewModel', JSON.stringify(<>));
Send this data with request return this._httpClient.post('api/controller', data);
Server
[HttpPost]
public async Task Post()
{
HttpPostedFile httpPostedFile = null;
var viewModel = JsonConvert.DeserializeObject(HttpContext.Current.Request["viewModel"]);
if (viewModel != null)
{
if (HttpContext.Current.Request.Files.AllKeys.Any())
{
var cnt = HttpContext.Current.Request.Files.Count;
for (int i = 0; i < cnt; i++)
{
httpPostedFile = HttpContext.Current.Request.Files["myFile" + i];
}
}
}
}