You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Using a javascript attachment handler to record the mime type as "application/vnd.openxmlformats-officedocument.wordprocessingml.document" for a docx file causes the following issue:
org.postgresql.util.PSQLException: ERROR: value too long for type character varying(40)
at com.mirth.connect.donkey.server.data.jdbc.JdbcDao.insertMessageAttachment(JdbcDao.java:547)
To Reproduce
This is the current content of the javascript attachment handler:
// Modify the message variable below to create attachments
var filename = ''+$('originalFilename');
if (filename != '') {
var extension = (filename.substring(filename.lastIndexOf('.')+1, filename.length) || filename).toLowerCase();
// work our mime type from extension
switch (extension) {
case 'pdf':
mimetype = 'application/pdf';
break;
case 'doc':
mimetype = 'application/msword';
break;
case 'docx':
mimetype = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
break;
case 'gif':
mimetype = 'image/gif';
break;
case 'jpg':
mimetype = 'image/jpeg';
break;
case 'tif':
mimetype = 'image/tiff';
break;
case 'png':
mimetype = 'image/png';
break;
case 'rtf':
mimetype = 'application/rtf';
break;
case 'txt':
mimetype = 'text/plain';
break;
case 'html':
mimetype = 'text/html';
break;
case 'mht':
mimetype = 'multipart/related';
break;
default:
mimetype = '';
}
}
var attachment = addAttachment(message.toString().replace(/[\r\n]/g,''), mimetype);
var attachmentToken = attachment.getAttachmentId();
return attachmentToken;
Environment (please complete the following information):
OS: Linux (CentOS)
Java 1.8.0_171
Connect Version 3.10.0
Workaround(s)
-- don't save the correct mime type?
The text was updated successfully, but these errors were encountered:
Describe the bug
Using a javascript attachment handler to record the mime type as "application/vnd.openxmlformats-officedocument.wordprocessingml.document" for a docx file causes the following issue:
org.postgresql.util.PSQLException: ERROR: value too long for type character varying(40)
at com.mirth.connect.donkey.server.data.jdbc.JdbcDao.insertMessageAttachment(JdbcDao.java:547)
To Reproduce
This is the current content of the javascript attachment handler:
Environment (please complete the following information):
Workaround(s)
-- don't save the correct mime type?
The text was updated successfully, but these errors were encountered: