Question

File Upload without pyWorkPage

Hi,

I need to know when and in which activity/control does pega actually uploads the attachment to the StaticContent directory.
We have a requirement where in we are not in a work object context (i.e. there is no pyWorkPage as such). So, we are opening a work object on a different page (lets say TempWorkObjectPage).
We added the OOTB "pyAdvancedAttachmentMenu" Menu on the screen and for the "Attach File(s)" option, using this page as the context.
When the user actually selects the file from its local drive, i am getting an error "** com.pega.pegarules.pub.PRRuntimeException: Can't continue with file attachment. File "file://web:/StaticContent/global/ServiceExport/Test Doc 1.txt" doesn't exist
".

When i trace it, i see that there is an activity - "Data-WorkAttach-File.pyUploadFile", in the java step system is searching for the file in the StaticContent directory and in my case not able to find it.

The same thing is working fine when i am actually in a work object context and have the pyWorkPage.

Note:- There are reasons that i cannot use pyWorkPage to open the work object. So, i need to find another way.

Thanks,
Piyush Arora

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Comments

Keep up to date on this post and subscribe to comments

Pega
November 13, 2018 - 5:52am

Can you explain more on your configuration? When you say you are not in work object context, are you using some other harness for uploading file?

 

Ideally only thing that is needed for file to be uploaded to temp directory is presence of form tag which is present in all harnesses except screen layout harness (portal harness).

November 13, 2018 - 8:34am

We can use "pzFilePathWithForm" Control to select the file from local drive and put it on the service export directory. In the post action (or button click), we can just read the file from service export.