No object DCH for MIME type multipart/related
Hi, everyone!!!
When I execute my code, I got this exception:
javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/related
boundary="----=_Part_0_20851530.1186777547859"
the funny things is : I got it work before. However, when I come back a few days to run, it doesn't.
I use tomcat 5.0,
mail.jar: version: 1.6
activation.jar:version: I don't know but I download the new ones in sun website.
Note: Also, when I run the code below in standalone application (java application), it works but doesn't work on tomcat application
Any help would be appreciate.
I tried some helps tips from other website such as http://www.jguru.com/faq/view.jsp?EID=237257
and still doesn't work :((((
***********Here is my code**********
********props is properties file...............
Authenticator auth = new SMTPAuthenticator();
// Get session
Session session = Session.getDefaultInstance(props, auth);
session.setDebug(true);
// Create the message
Message message = new MimeMessage(session);
// Fill its headers
message.setSubject(subject);
message.setFrom(new InternetAddress(from));
for(int x=0;x<recipients.size();x++)
message.addRecipient(Message.RecipientType.TO, new InternetAddress(recipients.get(x).toString()));
// Create your new message part
BodyPart messBodyPart=new MimeBodyPart();
// Set the HTML content, be sure it references the attachment
String htmlText="<h1>Hi</h1>"+"<img src=\"cid:picture\">";
// Set the content of the body part
messBodyPart.setContent(htmlText, "text/html");
// Create a related multi-part to combine the parts
MimeMultipart multipart=new MimeMultipart("related");
// Add body part to multipart
multipart.addBodyPart(messBodyPart);
// Create part for the image
messBodyPart=new MimeBodyPart();
// Fetch the image and associate to part
System.out.println("before dataSource");
DataSource fds=new FileDataSource(this.getString("image_location"));
System.out.println("After dataSource");
messBodyPart.setDataHandler(new DataHandler(fds));
System.out.println("*************** dataSource");
// Add a header to connect to the HTML
messBodyPart.setHeader("Content-ID", "<picture>");
// Add part to multi-part
multipart.addBodyPart(messBodyPart);
// Associate multi-part with message
message.setContent(multipart);
// Send message
System.out.println("Before Send");
Transport.send(message);
System.out.println("Finish");
}
Thank you for your response!!!
I already found the solution. For those who still having problem send e-mail, make sure to put mail.jar and activation.jar in the same location.
Also, make sure to check catalina.xml to make sure those jars are same location!!!->That what I found out.
->I put jars in same location of my eclipse project but it turns out, the tomcat app server didn't put them in same location.
Anyway, Thank you java_2006 for your response!!!!!
:)
Similar Messages
-
Javax.activation.UnsupportedDataTypeException: no object DCH for MIME type
hi there
i'm new to javamail and i'm trying to build a sample tool able only to send an e-mail.
i'm connecting to my office mail-server (web-mail). I'm sending from my office's address to an hotmail's address but i always receive the UnsupportedDataTypeException message. The same problem occurs if i mail to another user of web-mail
Have someone already encountered this problem?
Thanks in advance
here is my debug:
DEBUG: setDebug: JavaMail version 1.3.2
DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
DEBUG SMTP: useEhlo true, useAuth false
DEBUG SMTP: trying to connect to host "212.239.51.130", port 25, isSSL false
220 mail.euchia.it ESMTP
DEBUG SMTP: connected to host "212.239.51.130", port: 25
EHLO tim1
250-mail.euchia.it talking to [192.168.1.145] ([192.168.1.145])
250-ENHANCEDSTATUSCODES
250-SIZE
250-ETRN
250-ATRN
250-DSN
250-8BITMIME
250 HELP
DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg ""
DEBUG SMTP: Found extension "SIZE", arg ""
DEBUG SMTP: Found extension "ETRN", arg ""
DEBUG SMTP: Found extension "ATRN", arg ""
DEBUG SMTP: Found extension "DSN", arg ""
DEBUG SMTP: Found extension "8BITMIME", arg ""
DEBUG SMTP: Found extension "HELP", arg ""
DEBUG SMTP: use8bit false
MAIL FROM:<[email protected]>
250 2.1.0 <[email protected]>... Sender ok
RCPT TO:<[email protected]>
250 2.1.5 <[email protected]>... Recipient ok; will forward
DEBUG SMTP: Verified Addresses
DEBUG SMTP: [email protected]
DATA
354 Enter mail, end with "." on a line by itself
javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed; boundary="----=_Part_0_597230.1126769454656"
at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:851)
at javax.activation.DataHandler.writeTo(DataHandler.java:305)
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1206)
at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1611)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:526)
at javax.mail.Transport.send0(Transport.java:151)
at javax.mail.Transport.send(Transport.java:80)
at msgmultisendsample.main(msgmultisendsample.java:78)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)I hope this will help you.
http://jce.iaik.tugraz.at/products/03_cms/faq/index.php
Thanks,
Amol -
No object DCH for MIME type images/jpeg
what is the solution to this problem?
Thank you for your response!!!
I already found the solution. For those who still having problem send e-mail, make sure to put mail.jar and activation.jar in the same location.
Also, make sure to check catalina.xml to make sure those jars are same location!!!->That what I found out.
->I put jars in same location of my eclipse project but it turns out, the tomcat app server didn't put them in same location.
Anyway, Thank you java_2006 for your response!!!!!
:) -
Extension type for mime-type "multipart/form-data"
Hello:
If I want to register a mime-type of type "multipart/form-data" in WebLogic 6.0
what, if any, extension should I specify fot it in the web.xml? Is it necessary
to specify this mime-type for handling "multipart/form-data" type http requests?
Thanks
John
You cannot use request.getParameter() for Multipart/form-data.
You need to Use getInputStream and use the InputStream to read data.
Please Refer Jeason Hunters Implementation for the same. Its a very good example.
Kumar.
John Buckley wrote:
> Hmm. Strange. When I send in a multipart/form-data request and when I try to do
> a request.getParameter within my servlet it returns null and also throws a socket
> exception at the server console.
>
> Any ideas?
>
> John
>
> Mettu Kumar <[email protected]> wrote:
> >I don't think its neccesary as I am able to run my code with wls6.0 without
> >registering
> >multipart/form-data.
> >
> >kumar.
> >John Buckley wrote:
> >
> >> Hello:
> >> If I want to register a mime-type of type "multipart/form-data" in
> >WebLogic 6.0
> >> what, if any, extension should I specify fot it in the web.xml? Is
> >it necessary
> >> to specify this mime-type for handling "multipart/form-data" type http
> >requests?
> >>
> >> Thanks
> >>
> >> John
> >
-
I have a Macbook Air. I have MS office installed and work in Excel often with no issues. But When I download an excel spread sheet from a Ford web site I seem to be getting code and not the work sheet.
Example-
MIME-Version: 1.0
X-Document-Type: Workbook
Content-Type: multipart/related; boundary="====Boundary===="
--====Boundary====
Content-Location: file:///C:/HOLD.XHT
Content-Transfer-Encoding: 8bit
Content-Type: text/html; charset="utf-8"
<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">
<HEAD>
<meta name="Excel Workbook Frameset">
<xml>
<x:ExcelWorkbook>
<x:ExcelWorksheets>
<x:ExcelWorksheet>
<x:Name>BTB</x:Name>
<x:WorksheetSource HRef="./IBIT0001.xht"/>
</x:ExcelWorksheet>
<x:ExcelWorksheet>
<x:Name>GSM</x:Name>
<x:WorksheetSource HRef="./IBIT0002.xht"/>
</x:ExcelWorksheet>
<x:ExcelWorksheet>
<x:Name>RODetail</x:Name>
<x:WorksheetSource HRef="./IBIT0003.xht"/>
</x:ExcelWorksheet>
</x:ExcelWorksheets>
</x:ExcelWorkbook>
</xml>
</HEAD>
</HTML>
--====Boundary====
Content-Location: file:///C:/IBIT0001.xht
Content-Transfer-Encoding: 8bit
Content-Type: text/html; charset="utf-8"
<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">
<HEAD>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<style>
<!--table
{mso-displayed-decimal-separator:"\.";
mso-displayed-thousand-separator:"\,";}
@page
{margin:1.0in .75in 1.0in .75in;
mso-header-margin:.5in;
mso-footer-margin:.5in;
mso-page-orientation:landscape;}
tr
{mso-height-source:auto;}
col
{mso-width-source:auto;}
br
{mso-data-placement:same-cell;}
.style21
{color:blue;
font-size:10.0pt;
font-weight:400;
font-style:normal;
text-decoration:underline;
text-underline-style:single;
font-family:Arial;Try search/ask in the forum devoted entirely to Excel issues:
http://answers.microsoft.com/en-us/mac/forum/macexcel -
Unable to add Content-Type=multipart/related; type="text/xml";
hi all
am trying to add the following to my soap message that include attachment
but its not working
Content-Type=multipart/related; type="text/xml";
boundary="----=_Part_0_14732323.1039686671216";
Content-Length=4259;
can any body help plzzzzzzzzHello again,
My solution works and does not work. Content type is ok, but strange characters appear to the end of the attachment data.
Like this
...</E1EDS01></IDOC></ORDERS01>H úãž6×½ ã½5Õ×¼ÛgžÛNÝ}þ[ëMu201E
Where did these come from? I tested in a way that I changed the ContentType back to application/xml and attachment is fine again.
Regards,
Pekka -
Entity Object validation for "Date" type
I am trying to use the Entity Object validation for a Date field type, it is a required field.
I am using the format: MM/dd/yy HH:mm:ss
It is a simple validation where the date value must be less than or equal to the current date/time.
I tried using "Query Result" validation where the date is LESS THAN the query SELECT SYSDATE FROM dual.
This throws an error:
JBO-27011: Attribute set with value 2006-07-09 14:05:53.0 for LksrSurveyDte in LCFSReportService.LeakDetailView1 failed.
I have be unable to find help on validating dates using validation for an Entity Object and need some help.
Thanks in advance.In your case you can implement a service method in the VO to check if any other reservation overlaps with the new one (which is not inserted in the db).
I would use a an other VO (e.g. VODateCheck) for this. This VO has it's query build to check if a given roomid and a given startdate(time?) overlaps any other record for the roomid
select * from ReservationRoom where RoomId=:bindRoomId and ReservationEnd>=:bindReservationStartIf this query returns one or more rows you have an overlapping in the schedule and throw an error.
You call this VODateCheck from your service method in the other module before inserting the record. Set the bind variables in the VODateCheck and execute the query.
Timo -
How do I set the mime type for an attachment to "application/zip"
I'm sending out an email with a zip file as an attachment. The following code works fine, but the Mimetype for the attachment is set to "application/octet-stream"
FileDataSource fds = new FileDataSource(zipname);
DataHandler dh = new DataHandler(fds);
MimeBodyPart mbp2 = new MimeBodyPart();
mbp2.setDataHandler(dh);
mbp2.setFileName(fds.getName());
I would like the mime type to be application/x-zip. Unfortunately I seem to need a data content handler for this mime type as I get this exception.
javax.activation.UnsupportedDataTypeException: no object DCH for MIME type application/x-zip
Building a date content handler in the activation framework seems like a lot of work to do a very simple thing. Am I missing something obvious? Is there a simple way to do this?I found the solution after much chasing around. The default mimetypes file that comes with the activation framework does not list zip.
-
OSB defaulting Content-Type to "multipart/related" in case of attachments
I have scenario where I need to invoke a REST Webservice from OSB which accepts only media types which has "multipart/atom+xml". OSB is used for protocol transformation converting the SOAP request into the HTTP POST request with multipart. I have Proxy Service which will unwrap the message from the SOAP Body and post the same message into the payload of the Business Service and the attachment is passed 'as is' from the SOAP Service. The external REST Service Provider expects the media type to be "multipart/atom+xml", but in OSB when an attachment is present in the message, OSB is overrding the "Content-Type" proeprty to "multipart/related" inspite of me setting the "Content-Type" property of HTTP Transport Header in OSB and as result external RESTFUL Service is throwing "415-Unsupported Media Type" error. Below is the test results. One interesting thing is, it happens only when there is attachment present in the message. In case of a message which doesn't have attachment any "Content-Type" specified in the Transport Header is passed by the OSB to the external service. Any help is highly appreciated.
OSB Transport Header
Added the header <http:Content-Type>multipart/atom+xml</http:Content-Type>
Actual Raw Message
POST http://xxx7200:7004/XXXInterfaces/identify HTTP/1.1
Content-Type: multipart/related; type="text/plain"; start="<Root_-328322390>"; boundary=MIME_Boundary; charset=UTF-8
MIME-Version: 1.0
User-Agent: Java1.6.0_17
Host: xxx7200:7004
Accept: text/html, image/gif, image/jpeg, */*; q=.2
Proxy-Connection: Keep-Alive
Content-Length: 4823
Expected Raw Message
POST http://xxx7200:7004/XXXInterfaces/identify HTTP/1.1
Content-Type: multipart/atom+xml; boundary=MIME_Boundary;
User-Agent: Java1.6.0_17
Host: xxx7200:7004
Accept: text/html, image/gif, image/jpeg, */*; q=.2
Proxy-Connection: Keep-Alive
Content-Length: 4803
-KC
Edited by: 799459 on Apr 8, 2011 5:36 AM
Edited by: 799459 on Apr 8, 2011 7:02 AM
Edited by: 799459 on Apr 8, 2011 7:13 AM
Edited by: 799459 on Apr 8, 2011 7:14 AMHTTP content-type header has the following limitation as per osb doc.
Oracle Service Bus run time may overwrite these headers in the binding layer when preparing the message for dispatch. If these headers are modified, $inbound and $outbound are updated accordingly. So what you are seeing may be working as designed. Cant the remote service accept the multi part related content type set up by osb ? -
MIME Multipart/related to embed images in html files - Servlet
Hello,
My goal is to embed images in html/xhtml files to decrease latency when using slow networks. Think about mobile phones, if I have 10 images in one page, I will have 11 requests/responses to get the whole page.
The solution would be to embed all images using Content-type multipart/related, so I have one request to the whole pack.
How to do that in java? I mean, I need to set the content-type and build all parts encoding the images to base64.
I tried JavaMail API, there I can build messages like this and instead of send an e-mail, I can write:
myMimeMultipart.writeTo(response.getOutputStream());
The problem is: I am getting everything as text in my browser, including the MIME headers of each part. Another think is that the first header (the main one) doesn't appear too.
Any thoughts/other ideas?
Thanks in advance,
Andr� CarlucciIf memory serves me right, I believe in the Servlet spec you have access to the Response object. You "should" be able to set any headers you need there. In addition, you can get the output streams just as you described.
I did a similar thing, although slightly modified, to output dynamically-generated XLS (Excel Spreadsheet) files using a reporting engine called JasperReports. It wasn't a multipart response, however, so you may need to figure out how to handle that part of it, but in my case I set the mime-type header, then grabbed the output and started writing my XLS file too it. Once done, you close the streams and return the response. Worked perfect. -
How to set Mime Type for Static Files
Hi All,
I am working on Apex 3.2.1.00.10.
When I am trying to upload (create) a ".js" file into Static Files under Shared Components of an application; it is saving as "*text/plain*" for Mime Type. But I need Mime type to be set as "*application/x-javascript*".
Please help me to change the Mime type of .js file.
Or is there any way to upload the file directly as "*application/x-javascript*" as its Mime Type.
Thanks in advance.
UmeshIn IIS v4 which comes with the Windows NT4 option pack, you right click the web page you are working with, select properties, then go to the HTTP Headers tab. At the bottom there's a button labelled File Types in the MIME Map section.
After you've clicked that, you can add the two mime types you need;
Associated Extension MIME Type
.jar application/x-java-jar-file
.jnlp application/x-java-jnlp-file
I'm assuming that it is the same in W2k/IIS5. -
MIME type settings for browser are IGNORED
I have the following problem since Quicktime 7 Preview 2:
Quicktime by default has many mime types associated which I don't want to be played by quicktime in my browser.
For example .mp3
So I deselected everything but Quicktime movies in the mime type associations.
But no matter what I deselect there - Quicktime is stil playing everything in the browser.
It seems that Quicktime conmpleteley ignores the mime type settings in the preferences and plays everything by default!
What do I need to do to fix this?
In versions 7 Preview 1 an lower these settings worked just fine.
And as long as this isn't fixed I won't use Quicktime 7...The "hijacking" of files types and file extensions has been a part of every piece of software I can remember. Particularly with browsers and media files.
Not all browsers use the same types of plug-in architecture and this may be what you're experiencing.
It's been a long time since I fired up Internet Explorer on my Mac. Many browsers still use its style.
On a Mac (maybe the same on a PC) Internet Explorer uses its own "File Helpers" for MIME types. These can be edited using its "preferences".
Try changing the settings in IE. You'll find them under "helpers" (or something named like that).
Because Microsoft has tried to put its own formats in "front" of viewers these obstacles will now be part of much of your online experience.
User (viewers) do have most of the control. It's a shame that we have to fight just to get what we want in our online experience. -
Multipart/related part specifiers
Hi, this query is perhaps the result of my own limited knowledge regarding MIME types and part specifiers but here goes....
Based on the following BODYSTRUCTURE, I am attempting to determine the associated part specifiers so I may get the MIME headers for said part (i.e. A12 UID FETCH 147859 (BODY.PEEK[1.MIME])).
A11 UID FETCH 147859 (BODYSTRUCTURE)
* 1 FETCH (BODYSTRUCTURE (("TEXT" "PLAIN" ("CHARSET" "US-ASCII") NIL NIL "QUOTED-PRINTABLE" 911 16 NIL NIL NIL)(("TEXT" "HTML" ("CHARSET" "US-ASCII") NIL NIL "QUOTED-PRINTABLE" 2716 46 NIL NIL NIL)("IMAGE" "BMP" ("name" "ExchangeBabs.bmp") "<297231021@11102006-1D66>" NIL "BASE64" 2634474 NIL ("inline" ("filename" "ExchangeBabs.bmp")) NIL)("APPLICATION" "OCTET-STREAM" ("name" "Presence_K1=XItJBkk1xQi8X5JIgeeyjkn9EJTYKfxg9AogMsw3qHMhNnawbZ5wVWrmDFYTq1yP&MODE=IMG") NIL NIL "BASE64" 732 NIL ("inline" ("filename" "Presence_K1=XItJBkk1xQi8X5JIgeeyjkn9EJTYKfxg9AogMsw3qHMhNnawbZ5wVWrmDFYTq1yP&MODE=IMG")) NIL)("IMAGE" "GIF" ("name" "Blank Bkgrd.gif") "<297231021@11102006-1D6D>" NIL "BASE64" 202 NIL ("inline" ("filename" "Blank Bkgrd.gif")) NIL) "related" ("boundary" "-------45363d5545363d55") NIL NIL) "alternative" ("boundary" "-------446e3c8d446e3c8d") NIL NIL) UID 147859)
The com.sun.mail.imap.protocol.BODYSTRUCTURE object generated is shown below (I've omitted most of the fields and left what I considered relevent, simply enough to show the nesting):
bs= BODYSTRUCTURE (id=181)
bodies= BODYSTRUCTURE[2] (id=199)
[0]= BODYSTRUCTURE (id=207)
bodies= null
encoding= "QUOTED-PRINTABLE"
subtype= "PLAIN"
type= "TEXT"
[1]= BODYSTRUCTURE (id=208)
bodies= BODYSTRUCTURE[4] (id=213)
[0]= BODYSTRUCTURE (id=216)
bodies= null
encoding= "QUOTED-PRINTABLE"
subtype= "HTML"
type= "TEXT"
[1]= BODYSTRUCTURE (id=217)
bodies= null
encoding= "BASE64"
subtype= "BMP"
type= "IMAGE"
[2]= BODYSTRUCTURE (id=218)
bodies= null
encoding= "BASE64"
subtype= "OCTET-STREAM"
type= "APPLICATION"
[3]= BODYSTRUCTURE (id=219)
bodies= null
encoding= "BASE64"
subtype= "GIF"
type= "IMAGE"
subtype= "related"
type= "multipart"
subtype= "alternative"
type= "multipart"This particular message has a multipart/related content-type:
MIME-Version: 1.0
Content-Type: multipart/related;
type="text/html";
boundary="----_=_NextPart_001_01C6ED7A.EC20BF80"So, it has 4 part specifiers, one for each part in multipart/related. Now, the question to all this is can I determine from the BODYSTRUCTURE object what the root part is (i.e. that it's multipart/related)? Or am I going about this the wrong way (i.e. should I be examining the content-type header first to find out that its multipart/related and the first part is "text/html")?Basically, I'm trying to fetch various attributes of a message. In this case, the MIME headers of the various message parts (perhaps I'm stating the obvious but I'm not sure how to better explain what I'm trying to accomplish).
I've made some "progress". This morning when I continued working with the message described above, all of a sudden, the BODYSTRUCTURE I get back is different and as a result, the BODYSTRUCTURE object generated is different.
1 uid fetch 148032 (BODYSTRUCTURE)
* 1 FETCH (BODYSTRUCTURE (("TEXT" "HTML" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 2792 47 NIL NIL NIL)("IMAGE" "GIF" ("name" "Blank Bkgrd.gif") "<297231021@11102006-1D6D>" "Blank Bkgrd.gif" "BASE64" 202 NIL ("inline" ("filename" "Blank Bkgrd.gif")) NIL)("IMAGE" "BMP" ("name" "ExchangeBabs.bmp") "<297231021@11102006-1D66>" "ExchangeBabs.bmp" "BASE64" 2630728 NIL ("inline" ("filename" "ExchangeBabs.bmp")) NIL)("APPLICATION" "OCTET-STREAM" ("name" "Presence_K1=XItJBkk1xQi8X5JIgeeyjkn9EJTYKfxg9AogMsw3qHMhNnawbZ5wVWrmDFYTq1yP&MODE=IMG") NIL "Presence_K1=XItJBkk1xQi8X5JIgeeyjkn9EJTYKfxg9AogMsw3qHMhNnawbZ5wVWrmDFYTq1yP&MODE=IMG" "BASE64" 732 NIL ("inline" ("filename" "Presence_K1=XItJBkk1xQi8X5JIgeeyjkn9EJTYKfxg9AogMsw3qHMhNnawbZ5wVWrmDFYTq1yP&MODE=IMG")) NIL) "related" ("type" "text/html" "boundary" "----_=_NextPart_001_01C6ED7A.EC20BF80") NIL NIL) UID 148032)
1 OK FETCH completed.
bs= BODYSTRUCTURE (id=89)
bodies= BODYSTRUCTURE[4] (id=104)
[0]= BODYSTRUCTURE (id=115)
bodies= null
encoding= "QUOTED-PRINTABLE"
subtype= "HTML"
type= "TEXT"
[1]= BODYSTRUCTURE (id=116)
bodies= null
encoding= "BASE64"
subtype= "GIF"
type= "IMAGE"
[2]= BODYSTRUCTURE (id=117)
bodies= null
encoding= "BASE64"
subtype= "BMP"
type= "IMAGE"
[3]= BODYSTRUCTURE (id=118)
bodies= null
encoding= "BASE64"
subtype= "OCTET-STREAM"
type= "APPLICATION"
encoding= null
subtype= "related"
type= "multipart"NOTE: The UID differs from the previous example I'd given because I had archived the message and then moved it back to my Inbox.
Any ideas why the BODYSTRUCTURE reported by the server today is different from what it reported before? I have this message on both an Exchange 2000 and Mirapoint server. 2 days ago they both reported the BODYSTRUCTURE I indicated before, now they both have the BODYSTRUCTURE above.
PS. Sorry that this issue isn't really Javamail related anymore but I'd appreciate any input. -
MIME type issue in version 4.1/4.2 Compatibility Mode
Problem: when displaying a PDF file, it displays OK as PDF if APEX 'Compatability Mode' = 'Pre 4.1', but displays as HTML when in either '4.1' or '4.2' mode.
Apex: 4.2.2.00.11
DB: 11gr2
Web server: Apache on Linux
More detailed description... this seems to be a MIME type issue related to APEX (or maybe DB) versioning. The following code works as expected when run in 'Pre 4.1' mode - ie. it displays an appropriate PDF document in the appropriate Acrobat/other plugin in several browsers (Firefox/Opera/Chrome/IE). But just by changing 'Compatability Mode' to '4.2' (or even '4.1'), it then downloads the file but displays it as a bunch of random characters, and the web page header MIME type is 'text/HTML'.
Note: this also happens with other file types such as xls/doc/etc, but I expect fixing PDF should also fix these.
I'm at a bit of a loss as to where this is happening, it seems there is a difference in the 'Compatibility Modes' between either the creating of the HTML header using 'OWA_UTIL.mime_header' or the component path it traverses before reaching apache.
The only other thing I could think of is that we do a bit of redirection to display the PDF, though this seems like it might be a red herring. Basically we use page 560 as a container, and then display the PDF with page 561 within a frame embeded within page 560. So, on the page 560, which is the one we reference throughout the application, we have a region with a source of '<iframe src=?p=&APP_ID.:561:&SESSION.height="500" width="700"></iframe></pre>'. Then on page 561, in a 'On Load - Before Header' process, we make the call to the code 'DOWNLOAD_APPLICANT_PDF' (below).
Note: I did try calling 'apex_application.stop_apex_engine' after 'DOWNLOAD_APPLICANT_PDF', as suggested in a couple threads, but it didn't fix the problem, and caused a couple low-level system errors.
Code:
<pre>
CREATE OR REPLACE PROCEDURE DOWNLOAD_APPLICANT_PDF ( p_doc_id IN NUMBER
AS
v_length NUMBER;
lob_loc BLOB;
l_display_inline CHAR := '1';
BEGIN
SELECT pdf_data, DBMS_LOB.getlength (pdf_data)
INTO lob_loc, v_length
FROM pdf_dest
WHERE pdf_dest_id = p_doc_id;
OWA_UTIL.mime_header ('application/pdf', FALSE);
HTP.p ('Content-length: ' || v_length);
HTP.p ('Content-Disposition:inline;filename="mydoc.pdf"');
OWA_UTIL.http_header_close;
WPG_DOCLOAD.download_file (lob_loc);
END;
</pre>Hi,
for some background information about the above changed behavior, have a look at 4.2 Before Header Processes and Browser Security HTTP Headers of the APEX 4.1. release notes.
Regards
Patrick
Member of the APEX development team
My Blog: http://www.inside-oracle-apex.com
APEX Plug-Ins: http://apex.oracle.com/plugins
Twitter: http://www.twitter.com/patrickwolf -
Safari popup declares that a MIME type is unspecified...
Hi Fellow Safari Users!
Whenever I open certain websites (e.g. my own - http://www.bespoke-webwork.com/), Safari tells me that certain features are disabled because Mime Type is unspecified - i.e. a .mp3 file I optionally play on my homepage.
As a newcomer I am frustrated by the inability of Safari to cater universally for Mime types - specifically playing .mp3 files, without having to download RealPlayer... (why could it not be coped with internally by Safari??).
If anyone can suggest a way in which one can avoid such popups, without having to troubleshoot each one differently, I would be extremely grateful.
P.S.
Does downloading RealPlayer cure the problem anyway?As b noir suggests your html code is the cause of your troubles and this free software can help you write perfect code:
http://www.qtbridge.com/pageot/pageot.html
Your current code doesn't give proper instructions to any browser plug-in. The "embed" tag isn't properly closed. The "object" tag (used by Internet Explorer) uses the wrong audio "type" for the QuickTime plug-in. When I view your link I get two versions of the same song.
Fix the page code and your page will work with any browser.
Maybe you are looking for
-
Hello, several years ago I have had the product Adobe CS3 Design Premium installed on my PC. This is a purchased license student version. The problem with software features occurred a few days ago because I reinstalled my PC. Of course, I first deact
-
Send new message during exceptions
Currently in my BPM, i have a Exception block and 'Control Step' to trigger Alerts during exceptions. After my control step, Could I have a Transform step and 'send step' to generate a error message and send it to different system?
-
JAVA and MYSQL NOW() Function only displays year?
I have run into something interesting with running the MYSQL NOW() function. Here is what I'm running: SELECT NOW() from databaseThis gives me "2010" only. Any idea why this may be? If I run the same mysql query in mysql from the command line I get
-
Hi, Is there a way to get the current week for a ceratin date. (e.g id i input today 17/06/2008, i must receive 15/06/2007 - 21/06/2007) if sunday is my first week day or 16/06/2007 - 22/06/2007 if monday is my first day of week. kindly advice how ca
-
What this error mean. Help! I dont understand. The program is running when I try to run it but when I try to deploy it using JNLP it wont work. java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Me