Posted: 24 Nov 2016 4:39 EST 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.
***Updated by moderator: Lochan to add Categories***
I am also using the FilePath control in UI Portal (7.1.7 version). Then pyRequestor.pyFileUpload is not getting updated by using Filepath Control. Do we need to do any thing else for this?
The UpdateFile function in Java is not considering it as file if we manually try to set the path on pyRequestor.pyFileUpload (eg:file://web:/StaticContent/global/ServiceExport/123.txt) 123.txt existing file in local system .Could you please provide elaborated explanation for this .
Hi Prudhvi, I Have tried with other extensions also. I have gone through link provided by Akshay. I tried similar way. still i am facing issue.
Its working in for work object attachments scenario. but not in seperate portal UI with out object.
please help me in knowing details below.
1) Is the filepath control uploads a file to service export path? If so how , Where in filepath control it happens?(I have gone through control code. Not getting where it happens)
2)In UploadFile Function java code is in a way that it takes path from requestor page pyFileUpload. Which is service export path. How to check files present in service export path?
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?
Thanks Prudhvi, Helpful response from you.
Could you please tell which function in the "FilePath" script does this action to upload file to export path ? what are are the parameters required to upload a file.
I am using file path control in UI but the pyfileupload is not getting updated in requestor page.I am seeing null on pyFileUpload property.
Do we need to call any OOTB for a file to get saved to service export path. Suggest on this.