SecScreen: check for pdf only + log

This commit is contained in:
Samuele E. Locatelli
2020-08-06 12:20:08 +02:00
parent 3487e7a285
commit d0f1e2b025
+29 -10
View File
@@ -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)
{