Create file from BPM

,

I’m trying to create a PDF file from a BPM but the code I have used isn’t working.

I’m just using a basic bit of code.

using (var stream = new FileStream(filePath, FileMode.Create, FileAccess.Write, FileShare.Write, 4096))
{
    stream.Write(dataBytes, 0, dataBytes.Length);
}

I’m unsure as to why the file isn’t being created, as it is only pointing to ‘C:\TEMP’ and there are permissions for ‘EVERYONE’ as well as ‘Domain users’.

Am I being stupid and missing something really basic here?

Bpms run on the server, are you looking at the right place?

OMG I feel so stupid right now! Of course they do!

Do you have an idea of the best way to get a file to be created on a Client which could be used?

Probably will need a secondary process to scoop the file from the sever and send it to the client. If you put in some client info in your file, perhaps you can indicate where it needs to go? Or perhaps a file system listener to take the file and copy it to a shared folder where people can pick it up from

how about creating an email instead, and then email it to your user?

Files placed in the EpicorData folder on the server may be accessible through the Server File Download program. There are several folders to choose from depending on your security requirements. This is how SaaS users pull down payment files and how users can pull down the ERP logs.

You may have to create a Menu Item in an accessible area so users can utilize the program.

Cheers Tim, I think I will be going down this route!

1 Like