IDEMPIERE-5310 Email can't work in Archive Viewer for User/Contact #resolve (#1359)

This commit is contained in:
Carlos Ruiz 2022-06-08 03:25:15 +02:00 committed by GitHub
parent eb0366dba8
commit 0531cce28c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -72,6 +72,7 @@ import org.compiere.model.MLookup;
import org.compiere.model.MLookupFactory;
import org.compiere.model.MSysConfig;
import org.compiere.model.MUser;
import org.compiere.tools.FileUtil;
import org.compiere.util.DisplayType;
import org.compiere.util.Env;
import org.compiere.util.KeyNamePair;
@ -693,9 +694,7 @@ public class WArchiveViewer extends Archive implements IFormController, EventLis
MArchive ar = m_archives[m_index];
MUser from = MUser.get(Env.getCtx(), Env.getAD_User_ID(Env.getCtx()));
String fileName = System.getProperty("java.io.tmpdir") +
System.getProperty("file.separator") + ar.getName() + ".pdf";
File attachment = new File(fileName);
File attachment = new File(FileUtil.getTempMailName(ar.getName(), ".pdf"));
try {
Files.write(attachment.toPath(), ar.getBinaryData());
} catch (IOException e) {