We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Notes 6.5 -- Compress attachments within selected emails

jamalogist
jamalogist asked
on
Medium Priority
672 Views
Last Modified: 2013-12-18
In Lotus Notes 6.5, how do I compress or zip the files within all the emails I select/check?

Basically, I don't want to open each email, compress the spreadsheet, and re-attach it.

I'm pretty sure this can be done in bulk somehow, via one of the menu options.
Comment
Watch Question

Commented:
Hi

You can do this with various 3rd party Products.  One of them that I have found to be very good is ZIPMail by MKNetworks.

They have a product that you can install on your server and it goes through all DBs and detaches, ZIPs and Attaches all attachments in your DBs.

Link => http://www.mysolutions.co.za/product_03.html and http://www.mk-net-work.com/index.htm

There is a fee involved.  Dunno if you get free tools.

Cheers


Commented:
Below is the Agent that makes use of Java ScriptLibrary that makes possible to zip a file.
'Agent:
Sub Initialize
	Dim js As JAVASESSION
	Dim zipClass As JAVACLASS
	Dim zipFileObject As JavaObject
	Dim varFileToZip As String, varOutFilePath As String, returnCode As String
	Set js = New JAVASESSION
	Set zipClass = js.GetClass("ZipFile")
	Set zipFileObject = zipClass.CreateObject
	varFileToZip = "c:tempdocument.doc"
	varOutFilePath = "c:tempthezipfile.zip"
	returnCode = zipFileObject.zipMyFile(varFileToZip, varOutFilePath)
 
	If Not returnCode = "OK" Then
		Print "An Error occurred"
	Else
		Print "Zip went OK"
	End If
End Sub
 
 
 'Options:
Uselsx "*javacon" 'Which lets you use Java from LotusScript
Use "ZipFile"
 
 
'Java lib:
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.zip.Deflater;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
 
public class ZipFile {
 
	public String zipMyFile(String fileToZip, String zipFilePath) {
		String result = "";
		byte[] buffer = new byte[18024];
		
		// Specify zip file name
		String zipFileName = zipFilePath;
		
		try {
			ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFileName));
 
			// Set the compression ratio
			out.setLevel(Deflater.BEST_COMPRESSION);
 
			System.out.println(fileToZip);
			// Associate a file input stream for the current file
			FileInputStream in = new FileInputStream(fileToZip);
 
			// Add ZIP entry to output stream.
			out.putNextEntry(new ZipEntry(fileToZip));
 
			// Transfer bytes from the current file to the ZIP file
			//out.write(buffer, 0, in.read(buffer));
 
			int len;
			while ((len = in.read(buffer)) > 0){
				out.write(buffer, 0, len);
			}
 
			// Close the current entry
			out.closeEntry();
 
			// Close the current file input stream
			in.close();
 
			// Close the ZipOutPutStream
			out.close();
 
		} catch (IllegalArgumentException iae) {
			iae.printStackTrace();
			return "ERROR_ILLEGALARGUMENTSEXCEPTION";
			
		} catch (FileNotFoundException fnfe) {
			fnfe.printStackTrace();
			return "ERROR_FILENOTFOUND";
			
		} catch (IOException ioe){
			ioe.printStackTrace();
			return "ERROR_IOEXCEPTION";
		}
 
		return "OK";
	}
	
}

Open in new window

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Commented:
Well if jamalogist is not going to use this then I am going to give it a try : )  


Thanks mbonaci !

Author

Commented:
Thanks for the very quick responses.  I swear I've seen someone do it from what I thought was vanilla Notes 6.5, but I guess that's not possible.

So, I'll try these options out.  Maybe I'll install the 30-day ZipMail.  I'm not seeint pricing info on the site, but I suspect after that it's not free.

Author

Commented:
1) Go to the Inbox.  Clicking to the very left of an email places a check-mark.
2) Using these checkmarks, select all the emails you would like to process.
3) In the menu, choose [Actions] => [Attachment Options] => [Zip] or [Remove]

[Zip] will turn all attached spreadsheets into zip files, [Detach] fully deletes them.
The end result of either action is a smaller sized inbox / database.

No coding, no purchasing.

Author

Commented:
But -- does anyone know why this only seems to work in the Inbox -- not in any of the Folders?

I have to move an email back into my Inbox, do the Actions => Attachment Options, & move it back..
Commented:
To be honest I do not see that option in my Lotus Notes as you described.

Then again I'm using R8.5 and the databases are already enabled with LZ1 Compression as set in the Database properties.

I also cannot recall Notes ever having an option for ZIPPING an attachment as you have described.  Are you 100% certain that you guys do not already have a 3rd party tool that might be doing this?

It might be that your database is not set to compress attachments and the option to compress is available to you because of this and because your attachments are not compressed.  

Personally I do not think that LZ1 compression is the most effective way to ZIP/Compress your attachments.  Although you get some compression, you will get better results using a 3rd party tool.

Cheers
Sjef BosmanGroupware Consultant
CERTIFIED EXPERT
Commented:
Upgrade to R8.0.1

http://searchdomino.techtarget.com/news/article/0,289142,sid4_gci1318822,00.html

By the way, there are MANY tools available that do this. Don't waste a lot of time on this issue. Time equals money, doesn't it?

Author

Commented:
I suppose I can't rule out the possibility of a 3rd party plugin already installed allowing me to do this, though it looks native and well-integrated.  Thanks for everyone's ideas again.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.