diff --git a/NKC_WF/WebUserControls/cmp_secScreen.ascx.cs b/NKC_WF/WebUserControls/cmp_secScreen.ascx.cs index d0912f9..e6b444d 100644 --- a/NKC_WF/WebUserControls/cmp_secScreen.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_secScreen.ascx.cs @@ -163,15 +163,34 @@ namespace NKC_WF.WebUserControls } set { - // poiché è necessario copiare in locale il pdf... - string nameOnly = $"~/temp/{itemCode}.pdf"; - hfItemPdf.Value = nameOnly; - // svuoto files vecchi... - removeOldTemp(); - // copio in locale file... - File.Copy(value.Trim(), Server.MapPath(nameOnly)); - // update... - hlPdfOpener.NavigateUrl = nameOnly; + // check preliminare: deve essere un file ".pdf..." + if (value.Trim().EndsWith(".pdf")) + { + // poiché è necessario copiare in locale il pdf... + string nameOnly = $"~/temp/{itemCode}.pdf"; + hfItemPdf.Value = nameOnly; + // svuoto files vecchi... + removeOldTemp(); + try + { + // loggo che sto x copiare + logger.lg.scriviLog($"Requested copy from {value.Trim()} --> Server.MapPath(nameOnly)"); + // copio in locale file... + File.Copy(value.Trim(), Server.MapPath(nameOnly)); + } + catch (Exception exc) + { + string fullMessage = $"SecScreed: Exception on setPdfPath:{Environment.NewLine}{exc}"; + logger.lg.scriviLog(fullMessage); + } + // update... + hlPdfOpener.NavigateUrl = nameOnly; + } + else + { + string fullMessage = $"SecScreed: Error on pdfPath set value: [{value}]"; + logger.lg.scriviLog(fullMessage); + } } } @@ -217,7 +236,7 @@ namespace NKC_WF.WebUserControls { // valutato ma non usato pdf.js: // https://mozilla.github.io/pdf.js/examples/index.html#interactive-examples - + // se è variato da current... if (newDtmx != itemDtmx) {