Discussion

Display file from ServiceExprt using RelativePath

I am able to write a file using PRFile in the service export directory using the pxProcess.pxServiceExportPath (file://web:/StaticContent/global/ServiceExport/). Now, I am trying to display the same file as a hyperlink in a HTML using the <a href=""> tag which I am unable to do so. It shows me an obvious error: "Cannot find file 'file://web:/StaticContent/global/ServiceExport/Write.txt'. make sure the path or internet address is correct." Can anyone suggest how can I do that?

***Updated by moderator: Marissa to close 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

October 26, 2008 - 7:08pm

I have similar issue as well. Anyone has experience with opening file either from the server or from a binary stream on the clipboard?

March 13, 2009 - 12:27pm

I have seen many users posting questions on downloading a file from ServiceExport.

Solution is simple -
From your URL call the DownloadFile activity of Pega and provide just the filename as parameter. This activity will allow downloading of the file from ServiceExport directory

January 27, 2009 - 11:06pm

I am experiencing the same problem in PRPC v5.3. How is this configured? I cannot find any documentation related to this.

Thanks in advance.

January 30, 2009 - 4:30am

I think better u can try the option of
<a href=‘<p:r n= “pxRequestor. pxReqExportURI”/>/Write.txt’> Write </a>

December 16, 2009 - 7:19pm

I am trying to read an excel file present in ServiceExport directory. If i try to read a file (except excel) with PRFile, i am able to open the file properly. Since PRFile doesn't support excel, i had to use File to work with excel file.

The code:

java.io.File objFile = new java.io.File("file://web:/StaticContent/global/ServiceExport/try.xls");
workbook = jxl.Workbook.getWorkbook(objFile);

is throwing me an error "No such file or directory".

But the following code with fullpath is working.
java.io.File objFile = new java.io.File("//usr//IBM//WebSphere//AppServer//profiles//Pega_dev_cl//temp//laadws22Node04//pega_1_ws22//prweb_cl_sp3_war//prweb.war//StaticContent//global//ServiceExport//try.xls");
workbook = jxl.Workbook.getWorkbook(objFile);

I can't give the full path, since it differs for different environment and different node.

Please suggest someway to read the excel without using the full path.

December 17, 2009 - 7:09am

Hi,

I used property-set-sepcial to update the pxProcess.pxServiceExportPath with the pyID of work object, by this when user uploads a file a folder is created in temp directory with the name pyID and the file is present in that folder(note:A copy of the same file is also seen in global/service export).Is there a way we can have a path other than Temp directory for uploaded files.Does it take the temp directory path mentioned in prconfig.xml

Note :I have used the standard activity upload file for file upload

Thanks in advance.