in src/app/files/files.service.ts [519:556]
private uploadInternal(parent: ApiFile, files: Array<File>): Promise<Array<any>> {
let promises = [];
let forAll = null;
let overwrite = null;
this.showUploads(true);
for (let content of files) {
let apiFile = new ApiFile();
apiFile.name = content.name;
apiFile.type = ApiFileType.File;
promises.push(this.createSetContent(apiFile, parent, content).catch(e => {
if (e.status != 409) {
throw e;
}
if (overwrite === null) {
overwrite = confirm(content.name + " already exists. Would you like to overwrite existing files?");
}
let path = parent.physical_path + '\\' + content.name;
if (overwrite) {
this._notificationService.clearWarnings();
return this.getByPhysicalPath(path)
.then(existing => {
return this.setContent(existing, content)
.then(() => this.updateMetadata(existing, content));
});
}
else {
this.handleError(e, path);
throw e;
}
}));
}
return Promise.all(promises);
}