# WorkflowFileUpload object- press "Delete" from code behind?

**URL:** <https://discuss.workflowgen.com/t/workflowfileupload-object-press-delete-from-code-behind/679>\
**Category:** General WorkflowGen Discussion\
**Created:** [January 20, 2017, 10:18pm UTC](https://discuss.workflowgen.com/t/workflowfileupload-object-press-delete-from-code-behind/679 "2017-01-20T22:18:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![esanford](https://avatars.discourse-cdn.com/v4/letter/e/6bbea6/32.png) [@esanford](https://discuss.workflowgen.com/u/esanford)\
**Post date:** [January 20, 2017, 10:18pm UTC](https://discuss.workflowgen.com/t/workflowfileupload-object-press-delete-from-code-behind/679/1 "2017-01-20T22:18:21Z")

</div>

We’re showing/hiding a form section based on a radio button. If the user fills the section, then unchecks the button, we clear all TextBox fields from code behind, so the data isn’t submitted with the form. But the WorkflowFileUpload that’s in the section, if the user uploaded a file before hiding the section, will still upload the file into process data. I want to effectively click the Delete button for the WorkflowFileUpload control from code behind. It looks like there’s some jQuery event handler that’s doing… something on that button click, but I can’t figure out what, or how to otherwise remove the uploaded file before submitting the form. Ideas?

-Eric

---

<div class="post-metadata">

**Author:** ![kevin.lee](https://avatars.discourse-cdn.com/v4/letter/k/65b543/32.png) [@kevin.lee](https://discuss.workflowgen.com/u/kevin.lee)\
**Post date:** [January 31, 2017, 6:08pm UTC](https://discuss.workflowgen.com/t/workflowfileupload-object-press-delete-from-code-behind/679/2 "2017-01-31T18:08:27Z")

</div>

for file upload control in WFG, there is no visible field that you can just delete the value. To “delete” the file, there has been an old trick to clear the file by updating the associated form data value.

See article here if it can help:

> [@How can I delete a file attachment instead of adding/updating it using the standard .NET FileUpload control?](https://discuss.workflowgen.com/t/how-can-i-delete-a-file-attachment-instead-of-adding-updating-it-using-the-standard-net-fileupload-control/199):
>
> Issue How can I delete a file attachment instead of adding/updating it using the standard .NET FileUpload control? Background To do this, you need to set the FileUpload control as IN/OUT parameter in the WorkflowGen action so that the uploaded file can be imported and exported between the web form and WorkflowGen process data. When using the .NET FileUpload Control, a user can only browse and upload a file to WorkflowGen upon submission. This allows the user to update the file, but not to dele…

---

<div class="post-metadata">

**Author:** ![kevin.lee](https://avatars.discourse-cdn.com/v4/letter/k/65b543/32.png) [@kevin.lee](https://discuss.workflowgen.com/u/kevin.lee)\
**Post date:** [January 31, 2017, 9:19pm UTC](https://discuss.workflowgen.com/t/workflowfileupload-object-press-delete-from-code-behind/679/3 "2017-01-31T21:19:09Z")

</div>

Also since WFG.My 3.2.0 a new public method has been added to remove file from file upload control

> [@WorkflowGen.My and Workflow Web Controls v3.2.0](https://discuss.workflowgen.com/t/workflowgen-my-and-workflow-web-controls-v3-2-0/626):
>
> General Assemblies are no longer strong-named. Both assemblies are no longer strong-named in order to allow non-specific version dependency when referenced by other applications such as custom assembly SDK Workflow applications in WorkflowGen. This simplifies the deployment procedure of an assembly SDK Workflow application to WorkflowGen 6.2.0 and later, and allows upgrading WorkflowGen to a newer version without having to rebuild the application’s assembly that was referencing an older versio…
