# How to attach a excel file present in the service export directory to a work object?

**URL:** <https://forums.pega.com/t/how-to-attach-a-excel-file-present-in-the-service-export-directory-to-a-work-object/986>\
**Category:** General\
**Tags:** financial-services, pega-platform, case-management, system-architect\
**Created:** [December 23, 2020, 6:33pm UTC](https://forums.pega.com/t/how-to-attach-a-excel-file-present-in-the-service-export-directory-to-a-work-object/986 "2020-12-23T18:33:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![satishj17109538](https://avatars.discourse-cdn.com/v4/letter/s/7cd45c/32.png) [@satishj17109538](https://forums.pega.com/u/satishj17109538)\
**Post date:** [December 23, 2020, 6:33pm UTC](https://forums.pega.com/t/how-to-attach-a-excel-file-present-in-the-service-export-directory-to-a-work-object/986/1 "2020-12-23T18:33:52Z")

</div>

How to attach an excel file present in the service export directory to a work object?

---

<div class="post-metadata">

**Author:** ![PrakashDeep](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/prakashdeep/32/12790_2.png) [@PrakashDeep](https://forums.pega.com/u/PrakashDeep)\
**Post date:** [December 31, 2020, 3:56pm UTC](https://forums.pega.com/t/how-to-attach-a-excel-file-present-in-the-service-export-directory-to-a-work-object/986/2 "2020-12-31T15:56:23Z")

</div>

As you mentioned that the excel is present in service export directory, means you can read it. Read the excel file from the export directory.

1.Create an activity. In the activity, do the following.

2.Create a page of Data-WorkAttach-File class context.

3.Then encode the excel data stream into Base64.

4.copy the encoded value to pyAttachStream property under page step created in step 2

1. save the changes to WO.

---

<div class="post-metadata">

**Author:** ![satishj17109538](https://avatars.discourse-cdn.com/v4/letter/s/7cd45c/32.png) [@satishj17109538](https://forums.pega.com/u/satishj17109538)\
**Post date:** [January 1, 2021, 4:16pm UTC](https://forums.pega.com/t/how-to-attach-a-excel-file-present-in-the-service-export-directory-to-a-work-object/986/3 "2021-01-01T16:16:14Z")

</div>

set the file location to pxProcess.pyFileUpload property.

Used Uploadfile() OOTB function to get the Base64 encoded stream of excel file.  
set this stream text to pyAttachStream.

Created Data-WorkAttach-File instance and then Link-Attachment instance to attach this file with WO.
