I read somewhere that if a file has been uploaded in a form, the file can be downloaded in workflow. I need to be able to save the file to disk. Any ideas on how to do (script) this in workflow?
Question
Question
Answer
SELECTED ANSWER
replied on June 28, 2017
•
Show version history
Austin,
You can accomplish this with the following steps/workflow activities:
- Retrieve Business Process Variables
- Return uploaded/attached files (comes as a File Collection)
- For Each File
- Necessary because Forms file uploads are always a collection
- Workflow Script (put this inside the For Each File loop)
- Access the "ForEachFile_CurrentFile" token (this gives you the path info you need for each document attached to the form)
- See this post for more information on how to utilize the resulting path as some modifications are needed (they are using Result File in that example, but the overall process is the same)
- Use .NET to copy the current file from the WF server folder and put it wherever you want
0
0
Replies
replied on July 3, 2017
Jason,
Thank you very much! Your answer was spot on! We got it to work and the added link in the answer also was helpful. For anyone trying this out for the first time, just remember a few things;
1. The token to retrieve is
string TempStr=this.GetTokenValue("DownloadElectronicDocument_Result File").ToString();
2. The path you get will have a ":' that needs to be removed
3. Concatenate the result above to the path "C:\\ProgramData\\Laserfiche\\WF\\ServerData\\"
4. You have to do this quick, because it does disappear
0
0
You are not allowed to follow up in this post.