I want to make a workflow where i force the user to download a file.
But if i use response.TransmitFile(xxx), then it stops the form process and never gets completed. (but the file is bein downloaded).
I made a workflow where the user can select a file from the media library. And that returns a url. (So i convert it to a File.)
public override WorkflowExecutionStatus Execute(Record record, RecordEventArgs e)
{
if (!string.IsNullOrEmpty(ChoosenFile))
{
var filePathAndName = HostingEnvironment.MapPath("~" + ChoosenFile);
if (!string.IsNullOrEmpty(filePathAndName))
{
var file = new FileInfo(filePathAndName);
var response = HttpContext.Current.Response;
response.AppendHeader("Content-Disposition", "attachment; filename=" + file.Name);
response.AppendHeader("Content-Length", file.Length.ToString());
response.ContentType = ContentHelper.ReturnExtension(file.Extension.ToLower());
response.TransmitFile(file.FullName);
response.End();
return WorkflowExecutionStatus.Completed;
}
}
return WorkflowExecutionStatus.Failed;
}
It downloads the file, but stop the form progress..
I hope someone knows what to do ;)
Forms Workflow Download a file
Using Umbraco version 7.5.2; Umbraco Forms: 4.3.2
Hello everyone.
I want to make a workflow where i force the user to download a file. But if i use response.TransmitFile(xxx), then it stops the form process and never gets completed. (but the file is bein downloaded).
I made a workflow where the user can select a file from the media library. And that returns a url. (So i convert it to a File.)
It downloads the file, but stop the form progress.. I hope someone knows what to do ;)
Does anyone have an idea or solution to this issue?
The file gets downloaded, but the workflow doesn't get finished.
Does anyone has solution for not completing the workflow?
is working on a reply...