I've used scripts in Workflow before to export files and images from the repository to folders within our network, and this has worked very well.
For an example of the script I'm referring to, this is one I use often that exports 1 page from a selected entry and saves it as a JPG on the server (via a File Path token from the Workflow):
public class Script1 : RAScriptClass110 { /// <summary> /// This method is run when the activity is performed. /// </summary> protected override void Execute() { // Get document DocumentInfo doc = (DocumentInfo)this.BoundEntryInfo; // Initialize Document Exporter DocumentExporter dExp = new DocumentExporter(); // Export image from document var filePath = GetTokenValue("File Path").ToString(); dExp.PageFormat = DocumentPageFormat.Jpeg; dExp.ExportPage(doc,1,filePath); // Cleanup document object doc.Dispose(); } }
What I want to try to do now, that I'm not certain how to try to do, is I would like to push some of these image files into our public LFForms server, so that I can refer to them from public forms. I have set-up a subfolder within the img folder on the public LFForms server, and ensured that I can access it from the internal server. The problem I have is that since the public LFForms server is in the DMZ and not part of our domain, the same user credentials that are running Workflow do not work to access this shared folder on the DMZ server. I need to be able to access this network path using a different username and password. I don't mind having those credentials stored in the workflow. I just have no idea how to change the script to allow it to do the export using different credentials.
Has anyone done anything like this and could provide some guidance on how it works, or point me to some resources about it?
Thank you!