# How can I update a file type process data value within a custom WorkflowGen application?

**URL:** <https://discuss.workflowgen.com/t/how-can-i-update-a-file-type-process-data-value-within-a-custom-workflowgen-application/462>\
**Category:** Workflow Applications\
**Created:** [August 1, 2016, 8:44pm UTC](https://discuss.workflowgen.com/t/how-can-i-update-a-file-type-process-data-value-within-a-custom-workflowgen-application/462 "2016-08-01T20:44:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wfg-admin](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/wfg-admin/32/714_2.png) [@wfg-admin](https://discuss.workflowgen.com/u/wfg-admin)\
**Post date:** [August 1, 2016, 8:44pm UTC](https://discuss.workflowgen.com/t/how-can-i-update-a-file-type-process-data-value-within-a-custom-workflowgen-application/462/1 "2016-08-01T20:44:00Z")

</div>

**Question**

How can I update a file type process data value within a custom WorkflowGen application?

**Solution**

For file type process data you will be required to specify file reference details. The following&nbsp;sample code&nbsp;updates a File type process data parameter called `REQUEST_FILE` that is associated to a File type process data.

```auto
// Create a new WorkflowGen object for context parameters

WorkflowGen.My.Data.ContextParameters myWorkflowContextParameters = new WorkflowGen.My.Data.ContextParameters();

// instantiate a context parameter for REQUEST_FILE

ContextParameter myContextParam = new ContextParameter();

// Set the parameter name

myContextParam.Name = "REQUEST_FILE";

// Set the direction as OUT for the parameter

myContextParam.Direction = ContextParameter.Directions.Out;

// prepare myContextParam as file reference type 

myContextParam.Type = typeof(ContextFileReference);

// Create an object for the file reference to hold file details

ContextFileReference fileReference = new ContextFileReference();

// prepare a file to send to WFG as the REQUEST_FILE

FileInfo file = new FileInfo([THE_FILE_PHYSICAL_PATH]);

// Add the properties to the file reference object

fileReference.Name = file.Name;

fileReference.Size = file.Length;

fileReference.OriginalPath = file.FullName;

fileReference.DateLastModified = file.LastWriteTimeUtc;

fileReference.ContentType = "application/octet-stream";

fileReference.Path = file.FullName;

// update the context parameter "REQUEST_FILE" with this fileReference object

myContextParam.Value = fileReference;

// Update the Context with new file OUT param values

myWorkflowContextParameters.Update();

```
