tag:blogger.com,1999:blog-34020393.post4257826546823672273..comments2024-03-27T10:59:38.307-07:00Comments on Jim's PeopleSoft Journal: Manipulating Zip Files with PeopleCodeJim Marionhttp://www.blogger.com/profile/12995110203807924786noreply@blogger.comBlogger32125tag:blogger.com,1999:blog-34020393.post-28359164804738029922023-11-21T06:01:57.433-08:002023-11-21T06:01:57.433-08:00Hi Jim,
We have a requirement to zip the multiple ...Hi Jim,<br />We have a requirement to zip the multiple reports generated by a BIP report that gets placed on the report manager. We have restricted access to report repository and hence can't access the files. Any other way can we zip the reports before it gets published on report manager. <br /><br />Appreciate your help! Thank you!Sumahttps://www.blogger.com/profile/02506994349140946423noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-54676559758327740732021-03-23T13:49:46.533-07:002021-03-23T13:49:46.533-07:00Hi Jim,
I have requirement to add multiple files ...Hi Jim,<br /><br />I have requirement to add multiple files to a same zip file. I am referring to your code. I am able to generate the zip file but while accessing it , it's giving error 'central directory not found'. I think it's issues with the internal folder path I am giving ( folder1).Shubhamhttps://www.blogger.com/profile/17049309575791238955noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-50438583690089971952021-03-11T10:25:29.828-08:002021-03-11T10:25:29.828-08:00Take a look at https://blog.jsmpros.com/2008/05/ap...Take a look at https://blog.jsmpros.com/2008/05/appengine-output-tricks-reporting.html. In there you will find the SQL "SELECT PRCSOUTPUTDIR FROM PSPRCSPARMS WHERE PRCSINSTANCE = %ProcessInstance"Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-69033338675419716312021-03-04T08:59:14.714-08:002021-03-04T08:59:14.714-08:00Hi Jim, The zip file is getting created with dynam...Hi Jim, The zip file is getting created with dynamic names and generated on the server. How can I get the zip file on the process under view Log/Trace in PeopleSoft? <br /><br />Appreciate your help! Thank you!Sagaya Ahttps://www.blogger.com/profile/09202374341073476111noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-543659710251577462019-09-19T12:43:33.568-07:002019-09-19T12:43:33.568-07:00Hi Jim...
As a PSoft Developer, I love your posts....Hi Jim...<br />As a PSoft Developer, I love your posts. They give great insight into some developing techniques we don't often get to see.<br />Background: Our users have the ability to save multiple attachments for each employee inside the database. Now I need to develop a means to allow them to add all of the attachments (for a given employee) to a zip. I've implemented your code (modified slightly), but I'm running into a problem with code not finding the file(s). Is it possible to get an example of the code necessary to find the file(s) in the database?<br />Thanks in advance.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-34020393.post-13589053993555691572018-11-21T07:17:53.670-08:002018-11-21T07:17:53.670-08:00Hi Jim,
I am sorry to post a late comments on thi...Hi Jim, <br />I am sorry to post a late comments on this (by few years), but got in an issue after zip files are generated. I used the above code, and generated the output .zip files in process output directory, so as to make them available for downloading from 'View log/trace' link. .zip file is generated, along with original text file (which is being zipped). <br />Problem comes when downloaded zip file is being extracted on local drive, getting error as "An unexpected error is keeping you from copying the file. If you continue to receive this error you can use the error code to search for help with this problem. Error 0x80070057: The Parameter is Incorrect" <br />After this error, if extraction is cancelled, still the extract folder is created on local drive, and it contains proper folder structure defined, and contains files properly. <br />Not really sure if it is caused by the code or its an issue or server level. Tried migrating the code to other development instance as well, but facing the same challenge. Also checked on other local systems, still same challenge.<br />Not sure what I need to check in this case. <br />Thanks a lot for all the great posts on PeopleSoft techniques!<br />Always a follower.Sumanthttps://www.blogger.com/profile/17006778803665055646noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-62712672482082104802015-09-28T18:33:51.932-07:002015-09-28T18:33:51.932-07:00@Ankur, this post shows an old method for generati...@Ankur, this post shows an old method for generating zip files. My preferred method as of PT 8.53 is to use Java NIO Zip File system support.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-9275038170939822972015-09-28T02:12:58.629-07:002015-09-28T02:12:58.629-07:00@Jim :
Hi,
I have requirement to generate multip...@Jim :<br /><br />Hi,<br /><br />I have requirement to generate multiple file in a single zip file . We are developing reports using BI publisher with XML as data source . I am able to generate multiple files but each file is opening in different browser tab ( in chrome ) .I want when we click button 'Run report' ( As in our case we have custom page and there is button to run the reports ) then all files should be generated in a single zip file . <br /><br />Can you please help me out on this ?<br /><br />Thanks in advance.Ankurhttps://www.blogger.com/profile/07021078094320264730noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-12223506463367992992014-12-19T08:04:22.456-08:002014-12-19T08:04:22.456-08:00@Mike, if you have PeopleTools 8.53 or later, you ...@Mike, if you have PeopleTools 8.53 or later, you can use <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html" rel="nofollow">java.nio.files.File.copy</a>Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-22522184271989887672014-12-18T21:34:19.267-08:002014-12-18T21:34:19.267-08:00Hey,
I used the below method in AE-peoplecode, and...Hey,<br />I used the below method in AE-peoplecode, and its working fine , but my requiremnt is , I need both source and target file :<br /><br />Local JavaObject &source = CreateJavaObject("java.io.File", "/source/file.txt");<br />Local JavaObject &target = CreateJavaObject("java.io.File", "/target/file.txt");<br />&source.renameTo(&target);<br /><br />This method is working fine . but the issue is I need both source and destination copy.<br /><br />in this method , after moving the file , there is no copy file in my first folder . <br />Is there any copy file option are there in java ,, can be use in AE--peoplcode .<br />Even i used Putattachment function , Its throwing me an error like :<br />An invalid parameter has been passed to the file attachment function. (2,788)<br /><br />my code :PutAttachment(URL.A, &sFileName, GetURL(URL.B) | &sFileName)<br /><br />please help me , I need file copy in both URL/folder.(Yes ,its generating file in url B)..<br /><br />Mike Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-34020393.post-63912249390126046342014-06-24T09:56:20.647-07:002014-06-24T09:56:20.647-07:00Jim,
Since I'm not supposed to have any text ...Jim,<br /><br />Since I'm not supposed to have any text qualifiers, it looks like I'm going to have to go with option #2. I kinda figured that was the case, but didn't want to write it off.<br /><br />Thanks again!<br /><br />@BeccaBeccahttps://www.blogger.com/profile/04131563120118812329noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-66798915826809051822014-06-24T09:43:44.970-07:002014-06-24T09:43:44.970-07:00@Becca, the only other option I know of is to skip...@Becca, the only other option I know of is to skip the FileLayout and write directly to a file by iterating over a set of rows and applying the appropriate delimiters yourself.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-86345288993557738692014-06-24T09:42:50.614-07:002014-06-24T09:42:50.614-07:00@Becca, did you try enforcing quotes around text?...@Becca, did you try enforcing quotes around text?Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-48147727963131664002014-06-24T08:52:42.522-07:002014-06-24T08:52:42.522-07:00Jim,
I was surprised that I couldn't find a t...Jim,<br /><br />I was surprised that I couldn't find a thread on this topic already - so please excuse my placing this comment here.<br /><br />I'm creating a CSV file from data loaded into a temp table in an App Engine. This works flawlessly until you reach the requirement that any field in the CSV which is NULL should output a space:<br /> abc, ,1234, ,8/9/10, ,zyx<br /><br />I've ensured that the spaces are preserved in the record, but cannot seem to keep them when writing to the file. Any ideas?<br /><br />@BeccaBeccahttps://www.blogger.com/profile/04131563120118812329noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-23368468700297750052014-05-27T08:30:49.005-07:002014-05-27T08:30:49.005-07:00@Sandeep, good idea. I'll add it to the list.@Sandeep, good idea. I'll add it to the list.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-34754825898003096692014-05-26T12:13:29.871-07:002014-05-26T12:13:29.871-07:00@Jim - I am on PT 8.53. I have a requirement - The...@Jim - I am on PT 8.53. I have a requirement - There is a parent folder and it contains many child folders (Child Folder may or may not contains files like .doc/.pdf etc.). I have to create a zip contains these child folders and files within these child folders. Can you please guide me or provide sample code snippets for this. Appreciate your help in this regard.<br /><br />Thanks,<br />SandeepAnonymoushttps://www.blogger.com/profile/06860510028159608061noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-22613101786722697052014-05-23T08:10:15.818-07:002014-05-23T08:10:15.818-07:00@Sandeep, absolutely! It is easier if you are on P...@Sandeep, absolutely! It is easier if you are on PT 8.53 and can use the new Java ZipFileSystem.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-77219765650388541982014-05-22T23:56:34.104-07:002014-05-22T23:56:34.104-07:00Is it possible to multiple folders under a specifi...Is it possible to multiple folders under a specified path into one zip file using Peoplecode?Anonymoushttps://www.blogger.com/profile/06860510028159608061noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-59326027789482440262014-03-25T14:59:35.440-07:002014-03-25T14:59:35.440-07:00@ChiDONEt, I don't know if it is feasible, but...@ChiDONEt, I don't know if it is feasible, but an MD5 hash sum is a good way to verify files as well. If you can store that instead, or in addition to, that might be helpful. They do require additional time to generate, though.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-84073304528593783862014-03-25T14:29:22.622-07:002014-03-25T14:29:22.622-07:00Thanks Jim... I will post on PeopleSoft Forum Comm...Thanks Jim... I will post on PeopleSoft Forum Community...<br /><br />I know How to resolve, but I don't like my solution....check the file size of zip file and store on table, on the second run, if the size is the same, I can begin to process the zip file. ChiDONEthttps://www.blogger.com/profile/15864892513797114414noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-37462125360723730422014-03-24T13:49:27.677-07:002014-03-24T13:49:27.677-07:00@ChiDONEt, interesting use case. I don't have ...@ChiDONEt, interesting use case. I don't have an answer for you. If this is PeopleSoft related, you can try posting your question on the <a href="https://community.oracle.com/community/developer/english/peoplesoft_enterprise/peoplesoft_general_discussion" rel="nofollow">PeopleSoft OTN General Discussion forum</a>.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-18801798501017651902014-03-24T11:46:37.373-07:002014-03-24T11:46:37.373-07:00Is there any way to check the zip integrity, befor...Is there any way to check the zip integrity, before to open or begin with the process ? let me try to explain...I recieve by sftp a lot of zip files ( and I process at night ), but this week, I have a problema with a big zip file... while the zip file was arriving my process begin to open at the same time, and I not receive any security error from OS. Its to say that I can open the zip file while it is transfered... I try several things but I until now, I don't how can check if the trasnfer of the file was already finish and I can open the zip file. ChiDONEthttps://www.blogger.com/profile/15864892513797114414noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-5484846476174387522013-06-17T12:43:52.151-07:002013-06-17T12:43:52.151-07:00@Narender, yes, just set &zipInternalPath to &...@Narender, yes, just set &zipInternalPath to "".Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-36690653549698965062013-06-17T11:25:13.239-07:002013-06-17T11:25:13.239-07:00Hello jim,
I am using the code to zip multiple pd...Hello jim,<br /><br />I am using the code to zip multiple pdf's into a zip file. But when I unzip the files, the pdf's are under sub-directories.<br /><br />e.g if a pdf file is under<br />\\1.1.1\folder1\folder2\OutPut1.pdf<br />\\1.1.1\folder1\folder2\OutOut2.pdf<br /><br />then the resultant zip file has the following structure<br /><br />1.1.1\folder1\folder2\OutPut1.pdf <br />1.1.1\folder1\folder2\OutPut2.pdf <br /><br />Is there a way to not include the sub-directories but just the pdf files inside the zip files?<br />Anonymoushttps://www.blogger.com/profile/09665696614896643856noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-40763575961202202622013-01-15T22:13:56.371-08:002013-01-15T22:13:56.371-08:00@Raajesh, thanks for sharing!@Raajesh, thanks for sharing!Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.com