I want to upload an Excel file on Pega and then retrieve its content as base64.
While doing this, since the FilePath control hides the path, I am trying to combine the path with pxProcess.pxServiceExportPath and then read it with Java code, but I am constantly getting a file not found error.
Is it because Pega assigns unique values to the file that I cannot access it?
@MertK5088I tested the FilePath on my end and it looks like a form submission is needed to have the last uploaded file location. Can you try below?
Use pxRequestor.pyFileUpload as a property source in the FilePath control.
Add a button and define on click → refresh and use a transform or activity, then you can retrieve the file path using pxRequestor.pyFileUpload during the execution of data transform / activity.
I wrote the HTML code for the section myself and added a file input widget with a specified ID. Then, I created a button and added “Run Script” and used JavaScript to convert the file to Base64. Due to a synchronization issue, I also invoked the activity from within the JavaScript code to resolve the problem.
@EngincanYI am already calling the relevant Base64 value to the service using the refresh other section, and I am retrieving the relevant part within the activity in Java. However, I am still receiving the error that I have attached as a screenshot. Both AttachFile and FilePath works same.
@EngincanYI changed “Refresh this section” to “Refresh other” as you suggested, but I’m still getting the fakepath error. I think the issue is related to the screen being opened on top of the current screen using a local action. I believe it might be related to the “Replace Current” option in the local action settings.