Can I use writeallbytes in a bpm to copy a pdf report to any server except the Epicor server?

Here is my Data Directive on SysRptLst Standard. This puts the PDF file on the Epicor server/EpicorData/myuserdirectory. I need to put it on the file server instead of the Epicor server. Is there a way to do this?

Please help!

Thanks,
Richard

var ttSysRptLst_xRow = (from ttSysRptLst_Row in ttSysRptLst select ttSysRptLst_Row).FirstOrDefault();
if (ttSysRptLst_xRow != null)
{
    System.Threading.Thread.Sleep(10000);
    var hMonitor = Ice.Assemblies.ServiceRenderer.GetService<Ice.Contracts.ReportMonitorSvcContract>(Db);
    byte[] bytes = hMonitor.GetReportBytes(ttSysRptLst_xRow.SysRowID);
    if (bytes == null) throw new BLException("Bytes for PDF is empty.");
    var baseFolderType = Epicor.ServiceModel.Utilities.SpecialFolder.UserData;
    var userDataPath = Ice.Lib.PathHelper.GetFolderPath(Epicor.ServiceModel.Utilities.SpecialFolder.UserData); 
    var absoluteFileName = System.IO.Path.Join(userDataPath, "testrwz.pdf"); 
    File.WriteAllBytes(absoluteFileName, bytes);
}

A myriad of them.

Making an assumption of you being on prem, with write access to the server, you can just use the UNC path and write.

string fileServerPath = @"\\yourFileServer\yourShare\yourFilename";
File.WriteAllBytes(fileServerPath, bytes);

If my assumptions are true, that’s it. If not, explain what type of environment we are dealing with.

Once again, Thank you 1 million times Kevin.

Without your very helpfull information, I would be lost and unsuccessful!

You are the best!

Richard

1 Like