Question
Ness Technologies Inc.
IN
Last activity: 19 Jan 2017 0:55 EST
Upload a File and Read/Encode
Hi Team, I have a requirement to upload a file and save that file to particular location. I am uploading a file using FilePath control in UI and i am calling pyUploadFile activity to read/encode the file . pyRequestor.pyFileUpload is getting updated with service export path. But pyUploadFile activity is not considering it as a file from service export path , getting File doesn't exist error. This Scenario is independent , not related to work object attachments. Can any one assist in resolving this and do we need to do any thing to upload to service export path? And How file gets uploaded to service export path?
Thanks in advance.
Regards,
Suresh
***Updated by moderator: Lochan to add Categories***
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Blue Rose Technologies GmbH
BE
Hello,
Please have a look on the below link:
https://pdn.pega.com/community/pega-product-support/question/how-upload-file-remote-location
Thanks.
Ness Technologies Inc.
IN
Ness Technologies Inc.
IN
BlueRose Technologies
AU
Hi,
Have you tried with other file type extensions. Link provided by Akshay is helpful for your scenario.
Thanks,
Prudhvi
Ness Technologies Inc.
IN
Ness Technologies Inc.
IN
Virtusa IT Consulting
AE
You can create a file listener rule to read the uploaded file from service export path and encode it. You can write an intial activity in service file rule to read the buffer stream of the file and later in code you can handle the buffer as a file with proper extension if you want to store the file elsewhere, However the question is what sort of encoding you want to apply once you read the file from the directory?
JPMC
IN
why we need a file listner here?
filelistener will just listen whether there are any files in that particular location or not , but how come it will be used here .
Could you please explain your thoughts in detail.
BlueRose Technologies
AU
Hi Suresh,
Sorry for the delay.
1) Filepath control uploads files to Service export folder.
2) In my tomcat server, I can able to see the files whatever I have uploaded using the control in the below location.
C:\GCS\Temp\PRPC718\StaticContent\global\ServiceExport
Like that, please log in to your server and find for ServiceExport folder.
Thanks,
Prudhvi
Ness Technologies Inc.
IN
BlueRose Technologies
AU
We need not call any OOTB for a file to get saved to service export path and no parameters are required to upload a file.
On using Filepath control in the section, it is saving the files to Service Export folder.
I am not good at java but I suspect the below code is responsible for file upload to export path.
pega.u.d.registerOnBeforeSubmit(saveLocalFilePath, {thisId:"<p:r n='$this-name' m='NORMAL' />", targetId:"hiddenFilePath"})
Pegasystems Inc.
US
Hi Suresh
TRy this
If you have a button for "upload" call refresh section before you call the upload activity. Thsi will ensure the value is posted to the server.
another option would be to over ride the control , add a "onchange" event directly to the tag and call refresh / reload cell via JS function.