tag:blogger.com,1999:blog-34020393.post89684706464924143..comments2024-03-27T10:59:38.307-07:00Comments on Jim's PeopleSoft Journal: Exporting Attachments Part 2Jim Marionhttp://www.blogger.com/profile/12995110203807924786noreply@blogger.comBlogger167125tag:blogger.com,1999:blog-34020393.post-21973995011095085052024-03-15T08:31:05.506-07:002024-03-15T08:31:05.506-07:00@Top10+, that is what this post's iScript does...@Top10+, that is what this post's iScript does. You would generate a URL to the iScript, and the iScript would return the binary data.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-90165470101209421832024-02-13T23:04:00.772-08:002024-02-13T23:04:00.772-08:00@Jim "ViewAttachment function is the only met...@Jim "ViewAttachment function is the only method provided by the Attachment API that allows a user to view the contents of an attachment".<br /><br />Hi Jim, how can I get the http URL that the viewattachment function is creating because I want to show a PDF file into a PeopleSoft page using html area and html for that I am using Iframe and src but the problem is how can I get http URL of an attachment.<br /><br />Thank you.Top10+https://www.blogger.com/profile/15436421776211068505noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-9788469228710901112022-06-11T11:41:24.251-07:002022-06-11T11:41:24.251-07:00@Jakson, to have better control over the Exec, you...@Jakson, to have better control over the Exec, you might try the ideas in this post: https://blog.jsmpros.com/2010/02/exec-processes-while-controlling-stdin.html.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-60395578116639006682022-04-11T12:23:32.651-07:002022-04-11T12:23:32.651-07:00Thanks a lot Jim for time.
I will try your idea ne...Thanks a lot Jim for time.<br />I will try your idea next time. For now I could solve the problem last week.<br />I put an exec command and converted the file with the command DosToUnix(makes all lines have only LF) and for it to work properly in Application engine after that line I added some code to give exec some time to finish and then I could read huge files perfectly.Jaksonhttps://www.blogger.com/profile/09194068931221313457noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-14450446284576888602022-04-11T12:10:15.074-07:002022-04-11T12:10:15.074-07:00@Jakson, I understand what you are saying. Very in...@Jakson, I understand what you are saying. Very interesting. Seems to be a LF/CRLF thing. File attachments are stored in chunked tables, as demonstrated here. The problem is getting that binary into a file. Instead of %Response.WriteBinary as above, try %Response.WriteRaw.<br /><br />If you want to try keeping with the same routine, if you find that some lines are really two and have the line separator different, you can try a split, and iterate over the split rows as if they were new lines.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-55418783465398261452022-03-17T14:25:08.429-07:002022-03-17T14:25:08.429-07:00Hi @jim
I need a little help.
I have a default att...Hi @jim<br />I need a little help.<br />I have a default attach code where I place my CSV files into to a default attachrecord and I'm reading the file from a App Engine using GetAttachment to put the file into a folder in the UNIX app server and then get the file using GetFile. It's work fine until I get huge files with more than 1000 lines. Here is where my headache start.<br />For some reason in a certain moment the file.Readline lose the cursor and instead of read one line it reads two lines at once.<br />Eg.<br /><b><br />Setid, cust_id, comment - line 1<br />Setid, cust_id, comment - line 2<br />Setid, cust_id, comment Setid, cust_id, comment - line 3</b><br /><br />I notice that only happen when I move the file from DB to Unix App server, its something related to CR LF.<br />I would like to know if Is there a way to move my file from DB to App Server avoid Getattachment. Something using java objects? Jaksonhttps://www.blogger.com/profile/09194068931221313457noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-24189173852062102412021-03-02T03:15:24.253-08:002021-03-02T03:15:24.253-08:00Thank you for sharing your blog, seems to be usefu...Thank you for sharing your blog, seems to be useful information can’t wait to dig deep!Appsianhttps://www.blogger.com/profile/01063540998194332779noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-31700708697568746922019-01-28T08:26:44.441-08:002019-01-28T08:26:44.441-08:00@Test Analytics, the short answer is Yes. The long...@Test Analytics, the short answer is Yes. The longer answer is that you may have to make a separate IB call to get the content or you may have to use Java directly (from PeopleCode) because IB has poor support for binary files. It depends on the content you are fetching and requirements around the request.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-45768841900495993122018-11-14T23:19:14.769-08:002018-11-14T23:19:14.769-08:00@Madhukar.....No, Unfortunately i was facing the s...@Madhukar.....No, Unfortunately i was facing the same issue of session expiry so i had to change this requirement and had to go with PeopleSoft attachment functionality. whatever code i had given above will work for file upload but at the same time you will get logged out of peoplesoft. I could not find the solution and stop my research.<br /><br />If you find any solution, please let me know as well on my email - choubeyjee@gmail.com.<br /><br />All the best.<br /><br />Thanks!choubeyjeehttps://www.blogger.com/profile/15510827128629351912noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-36196738882551214092018-10-25T07:12:35.983-07:002018-10-25T07:12:35.983-07:00@choubeyjee : I have similar requirement. Did you ...@choubeyjee : I have similar requirement. Did you get the code working? If yes, can you post sample code?Madhukarhttps://www.blogger.com/profile/09927767999877293076noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-59041978123008302732018-08-06T12:42:03.875-07:002018-08-06T12:42:03.875-07:00Hi Jim,
My requirement is to maintain single file...Hi Jim,<br /><br />My requirement is to maintain single file repository for HCM and FIN systems. When the user attaches a file in HCM, the same file should be accessible from FIN page. What are the options available? How to transfer files though HTTPS to different server(Non peoplesoft) and make it available to download on the FIN page.<br /><br />Any help would be highly appreciated.<br /><br />Thanks, Kapz psspiderhttps://www.blogger.com/profile/14136719211799889670noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-32589546431844653112018-06-07T02:38:05.506-07:002018-06-07T02:38:05.506-07:00Hi Jim,
Thank you for the blog and discussion. I ...Hi Jim,<br /><br />Thank you for the blog and discussion. I was able to display pdf file content on page which was placed on ftp server using below code.<br /><br />Local File &imgFile = GetFile("FTP Absolute file Path", "R", "", %FilePath_Absolute);<br /><br />WorkRECORD.HTMLAREA = "<... width= ""700"" height= ""500"" src=""data:application/pdf;base64," | &imgFile.GetBase64StringFromBinary() | """/>";<br /><br />use iframe <br /><br />Thanks,<br />Preetipreetihttps://www.blogger.com/profile/11909154995656202469noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-30750112888086888312018-05-22T10:02:24.847-07:002018-05-22T10:02:24.847-07:00Hi Jim,
I'm working on consuming webservice s...Hi Jim,<br /><br />I'm working on consuming webservice so the 3rd party is providing file attachment URL in the response message. Is there a way to extract the file data from the URL and insert into peoplesoft database server?<br /><br />Please help.<br /><br />Thanks!Anonymoushttps://www.blogger.com/profile/17632234066416498845noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-46911547700854286352018-01-17T02:01:54.779-08:002018-01-17T02:01:54.779-08:00Hi Jim,
I am looking for solution on below problem...Hi Jim,<br />I am looking for solution on below problem:-<br /><br />Multiple files select in a single browse button and upload all of them together.Amol Kotkarhttps://www.blogger.com/profile/03889058280736975700noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-38043720521473249562017-09-21T02:50:35.723-07:002017-09-21T02:50:35.723-07:00Hi Jim,
I am reading this comment thread but wasn...Hi Jim,<br /><br />I am reading this comment thread but wasn't able to find answer to my question.<br /><br /><br />Our enhancement is to get all available files in a SFTP server where file names are dynamic. With that we really don't have visibility on the file names on the beginning so we don't know the file name to pass.<br /><br />Can we use get attachment to get multiple files like using *.* instead of the actual file name? From what i understand get attachment can only pull one file at a time.<br /><br />Thanks for your usual help!!<br /><br />Anonymoushttps://www.blogger.com/profile/09373313269202194573noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-58570655779372864762017-08-14T05:49:04.551-07:002017-08-14T05:49:04.551-07:00Hi Jim,
I have couple of questions.
1.When I at...Hi Jim,<br /><br />I have couple of questions. <br /><br />1.When I attach the file to the voucher, attachments are attaching correctly using the putattachment function.<br />I am attaching the outlook msg files. After attaching the file, I am trying to move the file to archive location, but the file showing zero size.<br />How do I get the original file to archive.<br />Please advice.<br /><br />2. When I open the Voucher page in Internet explorer, the attached msg file is not opening correctly. If I open in firefox , msg file is opening correctly.<br />are there any setting changes for IE?<br /><br />Please help me<br /><br />Thanks,<br />Laxman<br />Anonymoushttps://www.blogger.com/profile/00896520003442823516noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-80421321823419561632017-07-10T11:12:22.434-07:002017-07-10T11:12:22.434-07:00I prefer to use my Java classes directly in People...I prefer to use my Java classes directly in PeopleCode, but, as long as you have a main function, you could run the program from the command line. Danhttps://www.blogger.com/profile/15502251805949478749noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-74383301308136536712017-07-10T08:43:30.597-07:002017-07-10T08:43:30.597-07:00@Daniel - Thank you. So I need to write a java cla...@Daniel - Thank you. So I need to write a java class using Itext pdf functions and then call this java from the peoplecode? Is this how it works? is there is a command line to simplify this, meaning I would just call the command line to merge the pdfs and handle the rest in peoplecode? Just wondering? thank you so much for your help.rajchekhttps://www.blogger.com/profile/09523135755700585630noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-80278120618489115732017-07-07T15:33:41.627-07:002017-07-07T15:33:41.627-07:00@Raj - here's my method for retrieving and com...@Raj - here's my method for retrieving and combining PDFs using iText 5.4.0. pdfs variable is an ArrayList of PDF objects that is populated before calling this method. In this case PDFs are stored on Amazon S3.<br /><br /> /**<br /> * Retrieve PDFs that have been added and concatenate them into one PDF.<br /> * <br /> * @param filePath<br /> * Full path to concatenated file.<br /> * @throws Exception<br /> */<br /> public void getPdfs(String filePath) throws Exception {<br /> PdfCopy copy = null;<br /> Document document = null;<br /> if (pdfs.size() > 1) {<br /> for (Pdf pdf : pdfs) {<br /> File tempFile = File.createTempFile("temp", ".pdf", new File(<br /> tempPath));<br /> tempFile.deleteOnExit();<br /> // get file from s3 and save to the file system<br /> sa.getEncryptedPdf(pdf.getBucket(), pdf.getFileName(),<br /> tempFile.getPath(), pdf.getOwnerPassword());<br /><br /> PdfReader reader = new PdfReader(tempFile.getPath());<br /> document = new Document(reader.getPageSizeWithRotation(1));<br /> if (copy == null) {<br /> copy = new PdfCopy(document, new FileOutputStream(filePath));<br /> }<br /> document.open();<br /><br /> // Add each pdf page to new pdf<br /> for (int i = 1; i <= reader.getNumberOfPages(); i++) {<br /> document.newPage();<br /> PdfImportedPage page = copy.getImportedPage(reader, i);<br /> copy.addPage(page);<br /> }<br /> tempFile.delete();<br /> }<br /> if (document != null) {<br /> document.close();<br /> }<br /> if (copy != null) {<br /> copy.close();<br /> }<br /> } else if (pdfs.size() == 1) { // only one pdf - just decrypt and store<br /> Pdf pdf = pdfs.get(0);<br /> sa.getEncryptedPdf(pdf.getBucket(), pdf.getFileName(), filePath,<br /> pdf.getOwnerPassword());<br /> }<br /> }Danhttps://www.blogger.com/profile/15502251805949478749noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-74733397659449507452017-07-07T09:25:53.478-07:002017-07-07T09:25:53.478-07:00@Jim,@Daniel - Thank you for the quick response. I...@Jim,@Daniel - Thank you for the quick response. I started looking into itext and gave info to client so they can purchase the library. Is there is a sample code you can share for calling these itext libraries from Peoplecode?<br /><br />@Jim, downloaded Apache PDFbox and will research the library and post my findings.<br /><br />Thanks<br />Raj.rajchekhttps://www.blogger.com/profile/09523135755700585630noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-57168224254978557512017-07-06T21:30:25.118-07:002017-07-06T21:30:25.118-07:00@Raj - I have used the iText library that Jim ment...@Raj - I have used the iText library that Jim mentions to combine pdfs into a single PDF and display to the user with FileAttachment. Danhttps://www.blogger.com/profile/15502251805949478749noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-42891154128586067662017-07-06T19:40:16.101-07:002017-07-06T19:40:16.101-07:00@Raj, as you found out, combining PDF's throug...@Raj, as you found out, combining PDF's through concatenation is incorrect. I recommend finding a PDF library you can use from Java. Working with the overloaded Java classes will be hard. My preferred work around is to create custom Java classes with helper methods to communicate with the Java library. I have worked with iText, but I see there are others now, including Apache PDFBox. I've never used it, but any project run by the Apache Software Foundation is worth investigating.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-62611925560135073082017-07-06T14:34:49.384-07:002017-07-06T14:34:49.384-07:00@Jim, We are storing pdf files related to employee...@Jim, We are storing pdf files related to employees in PS Records(using attachment framework). Now the requirement is that based on some report or process parameters we need to retrieve these employee pdfs, merge into one pdf and show in the process monitor so the users can print one form instead of many. How can I merge these pdf files from AE or SQR? I have tried with reading the FILE_DATA field for all Emplid's into a record object using AE process and write into a new file GetFile().WriteRaw. It works with one file. Writing more than one file results in an corrupted PDF. Is this the right way to merge PDF's? Please suggest me on this. Thanks for your help. <br /><br />- Raj.rajchekhttps://www.blogger.com/profile/09523135755700585630noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-69106988773779348942017-06-20T20:57:04.201-07:002017-06-20T20:57:04.201-07:00Thanks Jim
-KenThanks Jim<br /><br />-KenAnonymoushttps://www.blogger.com/profile/00896520003442823516noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-18524152750267233032017-06-17T07:23:44.117-07:002017-06-17T07:23:44.117-07:00@Ken, I would start with the PDF created. It can b...@Ken, I would start with the PDF created. It can be bursted into a process scheduler folder. I would then use the PeopleCode function to send email, including PDF attachment. The key is the PDF file has to be available in the file system.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.com