Web: PortalSettings: Restore: A file extension was added in restoring the portal from a file.

This commit is contained in:
Tatiana Lopaeva 2023-10-26 11:50:19 +03:00
parent b7605d530a
commit cd2ecb8e59

View File

@ -196,12 +196,8 @@ class BackupStore {
setDefaultOptions = (t, periodObj, weekdayArr) => {
if (this.backupSchedule) {
const {
storageType,
cronParams,
backupsStored,
storageParams,
} = this.backupSchedule;
const { storageType, cronParams, backupsStored, storageParams } =
this.backupSchedule;
const { folderId, module } = storageParams;
const { period, day, hour } = cronParams;
@ -645,11 +641,20 @@ class BackupStore {
try {
const url = "/backupFileUpload.ashx";
const getExst = (fileName) => {
if (fileName.endsWith("." + "tar.gz")) {
return "tar.gz";
}
return fileName.substring(fileName.lastIndexOf(".") + 1);
};
const extension = getExst(this.restoreResource.name);
const res = await uploadBackup(
combineUrl(
window.DocSpaceConfig?.proxy?.url,
config.homepage,
`${url}?init=true&totalSize=${this.restoreResource.size}`
`${url}?init=true&totalSize=${this.restoreResource.size}&extension=${extension}`
)
);