Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to zip a file?

Eduardo SchurtzFeb 23 2011 — edited Feb 24 2011
Hi folks...

I need to zip a file from Oracle Forms 6i (Oracle EBS 11.5.2.10) or a PL/SQL object to send it by e-mail.

I did a search and the only solution that I found was using Java:

*1) Create a java file like:*

import java.util.zip.*;
import java.io.*;

public class zipfile
{
public boolean addFile(String filename,String outFilename)
{
try {
int len;

ZipOutputStream out = new ZipOutputStream(new FileOutputStream(outFilename));
FileInputStream in = new FileInputStream(filename);
// Add ZIP entry to output stream.
out.putNextEntry(new ZipEntry(filename));
byte[] buf = new byte[1024];
while ((len = in.read(buf)) > 0)
{
out.write(buf, 0, len);
}
in.close();
out.closeEntry();
out.close();
return true;

} catch (IOException e)
{
return false;
}
}

}

*2) Compile this file and import it at Oracle forms using Import Java Classes. But when I try to import this file I get the following error:*

Importing Class Zipfile...
Exception occurred: java.lang.UnsupportedClassVersionError: Zipfile (Unsupported major.minor version 50.0)

What can be? Other Ideas to zip a file using Forms or PL/SQL?

tks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 24 2011
Added on Feb 23 2011
6 comments
1,248 views