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 '&lt;iframe src=?p=&APP_ID.:561:&SESSION.height="500" width="700"&gt&lt;/iframe&gt</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

Similar Messages

  • Mime Type issue with .docx Files in Apex 4.0

    We are having issues with windows 2007 .docx documents that are when they are viewed on windows 2007 machines with ie8. If I look in the storage table the mime type is not set correctly. It is being set as application/octet-stream. When we download the file one windows 7/IE8 either the browser thinks it is a zip file or it does not recognize it.
    If I go into the back end and update the table with the correct mime type application/vnd.openxmlformats-officedocument.wordprocessingml.document it works fine.
    We have tried to update mime types on the apache server but this does not help.
    Apex seems to be deciding what mime type to populate the table with.
    It seems like I need to update apex somehow to recognize that a .docx extension should be stored as type mime type application/vnd.openxmlformats-officedocument.wordprocessingml.document.
    Does anyone know how I would do this?
    We are running Apex 4 on 10g IAS with mod/plsql
    are application is setup very similar to what is describe in this document by David Peak
    http://www.oracle.com/technetwork/issue-archive/2009/09-jan/o19browser-087025.html
    Edited by: user7660930 on Apr 18, 2011 7:40 AM

    I thought about trying to do something similar to the code above but would prefer that apex would work properly.
    I created a page with the sql region and added this code
    owa_util.print_CGI_ENV
    when I run it it shows the following environment variables. It look like the WebDB environment HTTP_ACCEPT value needs to be updated. Does any one know how to update this information on a 10gIAS server and were it is stored? I have some documenation on WebDB but none of it seems to point to the correct location of the files and there are no admin pages
    PLSQL_GATEWAY = WebDb
    GATEWAY_IVERSION = 2
    SERVER_SOFTWARE = Oracle-Application-Server-10g/10.1.2.2.0 Oracle-HTTP-Server
    GATEWAY_INTERFACE = CGI/1.1
    SERVER_PORT = 4445
    SERVER_NAME = admsunxapp04.ad.jocoks.com
    REQUEST_METHOD = GET
    QUERY_STRING = p=301:1:3167922978599440:::::
    PATH_INFO = /f
    SCRIPT_NAME = /pls/apex/sand
    REMOTE_ADDR = 172.16.14.100
    SERVER_PROTOCOL = HTTP/1.1
    REQUEST_PROTOCOL = HTTPS
    REMOTE_USER = APEX_PUBLIC_USER
    HTTP_USER_AGENT = Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; Tablet PC 2.0)
    HTTP_HOST = admsunxapp04.ad.jocoks.com:4445
    HTTP_ACCEPT = image/jpeg, application/x-ms-application, image/gif, application/xaml+xml, image/pjpeg, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
    HTTP_ACCEPT_ENCODING = gzip, deflate
    HTTP_ACCEPT_LANGUAGE = en-US
    HTTP_ORACLE_ECID = 1303315270:172.16.2.9:3032:0:2526,0
    WEB_AUTHENT_PREFIX =
    DAD_NAME = apex/sand
    DOC_ACCESS_PATH = docs
    DOCUMENT_TABLE = wwv_flow_file_objects$
    PATH_ALIAS =
    REQUEST_CHARSET = AL32UTF8
    REQUEST_IANA_CHARSET = UTF-8
    SCRIPT_PREFIX = /pls
    HTTP_COOKIE = ORA_WWV_R1=%23ALL; ORA_WWV_R2=%23ALL; ORA_WWV_R3=%23ALL; ORA_WWV_ATTRIBUTE_PAGE=4651%2C%23ALL; ORA_WWV_REMEMBER_UN=ADMIN:apex_app; ORA_WWV_USER=8A32E6579024A4F4; oracle.uix=0^^GMT-5:00; DEVL=WaSkGBNfJ6-Vgpw-6HXpHvM8:S

  • MIME-type issue???

    I have installed WLS 6.1 and have placed my index.html file in the
    applications/DefaultWebApp_myserver. Everything works fine. For
    organizational purposes, I want to place all of my documentation in
    DefaultWebApp_myserver/doc. When I display a MS Word document (IE 6),
    within the /doc subfolder, the document displays as ascii text. However, if
    I place the document in the DefaultWebApp_myserver folder, it displays
    correctly as a Word document.
    Additionally, Excel (xls) documents display as ascii/text regardless of
    their location.
    Any ideas or suggestions would be greatly appreciated.
    Thanks
    Jed Zimmer

    Kumar,
    I've tried all combinations of the following with no luck:
    Extensions:
    <extension>.doc</extension>
    <extension>doc</extension>
    <extension>DOC</extension>
    MIME-types:
    <mime-type>application/winword</mime-type>
    <mime-type>application/msword</mime-type>
    <mime-type>application/ms-word</mime-type>
    I restarted the web server after clicking the "persist" button from the web
    descriptor page. My directory structure is as follows:
    Root location: .../mydomain/applications/DefaultWebApp_myserver
    Doc location: .../mydomain/applications/DefaultWebApp_myserver/doc
    Location of web.xml:
    .../mydomain/applications/DefaultWebApp_myserver/WEB-INF
    Once again, viewing a Word document, located in the root location, works
    fine. Viewing a Word document in the /doc subdirectory displays as ascii
    text.
    Thanks again for your help.
    Jed Zimmer
    "Kumar Allamraju" <[email protected]> wrote in message
    news:[email protected]..
    you should define the following mime-type in your web.xml
    <mime-mapping>
    <extension>doc</extension>
    <mime-type>application/ms-word</mime-type>
    </mime-mapping>
    Kumar
    Jed Zimmer wrote:
    I have installed WLS 6.1 and have placed my index.html file in the
    applications/DefaultWebApp_myserver. Everything works fine. For
    organizational purposes, I want to place all of my documentation in
    DefaultWebApp_myserver/doc. When I display a MS Word document (IE 6),
    within the /doc subfolder, the document displays as ascii text.
    However, if
    I place the document in the DefaultWebApp_myserver folder, it displays
    correctly as a Word document.
    Additionally, Excel (xls) documents display as ascii/text regardless of
    their location.
    Any ideas or suggestions would be greatly appreciated.
    Thanks
    Jed Zimmer

  • Ristretto or maybe generic mime.types issue: case of file extension?

    Good day.
    Ristretto (the XFCE image viewer) wouldn't recognize the .TIF files I copied over from a Windows partition until I renamed them to .tif. Lowercase .tiff and .tif are indeed the only two file extensions that are mentioned for image/tiff in /etc/mime.types but I thought this was somewhat unexpected (and unwanted).
    Is it a per-app decision whether or not to do case-sensitive extension compares? Is it a problem? And if so, in mime.types or in ristretto?
    Regards,
    Rene

    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

  • Mime type issues: x-directory/normal vs. inode/directory

    Sorry for the long post. If you have no time, just read the third paragraph, starting with "Of course..."
    I am using KDE and I have a problem with the mime types for directories. As Gnome, too, KDE manages mime types itself to offer easy customizability by means of GUIs. Obviously, KDE programs natively adhere to these settings. When a non-KDE application wants to open a file of a certain mime type, it should call "xdg-open" which checks for the desktop environment and the calls the "kde-open" script to use KDE's own mime type hierarchy. However, when a program does not call "xdg-open", the (by now ancient) /usr/share/applications/mimeinfo.cache is read. This file is created by /usr/bin/update-desktop-database, which is executed in many PKGBUILDs (well, actually the .install files) to update mime information after installation.
    The problem I am running into is that Zotero, a Firefox extension for bibliography management, does not open Dolphin, KDE's file manager, but EasyTag, a music file ID tag editor whenever a folder is supposed to be opened. A quick look at /usr/share/applications/mimeinfo.cache shows that Dolphin is registered as an application for the mime type "inode/directory", but not for "x-directory/normal", for which EasyTag is registered. Simply adding Dolphin as the first app in the array for "x-directory/normal" solves the problem, but only until the next update of a program calling /usr/bin/update-desktop-database. I thus wrote an alias command to call a selfmade script which uses sed to rectify this after each call of update-desktop-database.
    Of course, this is not a nice solution. Thus my question (Google didn't help much): What is the standard mime type for directories? AFAICT, it should be "inode/directory", but what, then, does "x-directory/normal" do and why is it used? What should the solution be? Should Dolphin register the additional mime type?
    I suspect an error on behalf of the KDE devs as I just realized that a few other KDE programs don't claim certain mime types, either: Okular does not claim "application/pdf". The GIMP, however, does, even though it cannot handle this mime type.
    Thanks for your patience.

    skottish wrote:You can override the system level mimeinfo.cache with your own copy in ~/.local/share/applications. Only put in the stuff that you want; There's need to copy the whole file.
    An even better workaround. Nice!
    skottish wrote:Slightly off topic, but GIMP can open PDF files.
    Not here: "Opening '/home/user/test.pdf' failed: Unknown file type"
    Last edited by mutlu_inek (2009-08-08 21:49:37)

  • CLM Mail MIME Type Issue

    Users are entering special characters in the instructions to the signatory, and when the string is picked up into the custom email, the system is mis-translating the characters in the CLM.We suspect on the custom java mail util not setting up the MIME Type.
    Any help would advise on this

    In custom email, you manually set the content type. Here is an example:
    msg.setContent(txt,"text/html");
    where txt is the formatted string.
    and msg is of type MimeMessage.
    Incase you are using the method "setText", change it as shown above and it should work fine
    Regards,
    Immanuel

  • Get client browser version in C# (When IE Compatibility mode enabled)

    We need to know client's browser version from C# code (Server side). We use Request.Browser or HTTP_USER_AGENT to get the details.
    However, In IE when compatibility mode is enabled it always returns IE 7 version irrespective of version of IE. ie, even in IE 11 when compatibility mode enabled it returns IE 7 but I want actual version which is IE 11. Is there any way I can get actual IE
    version?

    this is a c# forums section, you can post in the asp.net forums:>
    forums.asp.net
    Mark as answer or vote as helpful if you find it useful | Ammar Zaied [MCP]

  • Quicktime MIME types translated in non-english versions

    In the continuation of a previous thread, there seems to be a problem with the last quicktime update that translated mime types's names (and using chars like "í" and "á), in non-english versions of quicktime and macosx (in my case, portuguese versions), that might conflict with browsers like firefox, preventing them from opening embed vídeos. For example, i have MIME types with names like "aplicação/x-rstp" and "áudio/x-mp3" which are causing several issues. How can I change them back to english and solve this problem?
    Thanks in advance.

    No one?

  • Servlet application MIME type browser window issue

    Hi,
    I am writing a servlet that launches an application on a citrix server and as such the MIME type is as below:
    response.setContentType("application/x-ica");
    The user is supposed to click an internet explorer link on their desktop and the application will open, however currently a browser window opens and remains blank while the application launches and does not close until done so manually. I have seen examples where users can click a link and the browser window closes itself straight away, and the application continues to launch.
    Can anyone advise how to correct this problem?
    Thanks.

    I've found out what the problem was, wasn't related to the servlet itself it was a client side custom component making multiple requests, which the app replied to with different content types.
    Thanks.

  • An error occurred during the installation of assembly 'policy e0.Microsoft.VC80.CRT.type="win32-policy" version "8.0.50727.4053", publicKeyToken="1fc8b3b9a1e18e3b" ,processorArchitecture="amd64"'.  Please refer to Help and Support for more information.  H

    An error occurred during the installation of assembly 'policy 80.Microsoft.VC80.CRT.type="win32-policy" version+"8.0.50727.4053", publicKeyToken="1fc8b3b9a1e18e3b" ,processorArchitecture="amd64"'.  Please refer to Help and Support for more information.  HRESULT: x...
    Encountered during reinstall of iTunes.  Any ideas?

    It is a big issue for many users.  There is no clear fix yet, but some users have had success with some of the solution on this thread.
    https://discussions.apple.com/message/16751339#16751339

  • When I try to click on a download link for a .pdf file Firefox does not recognize the MIME type and tries to download the file as "index.php"

    When visiting a site I frequent I tried to download a linked .pdf file. Previously I've used Firefox 7.0.1 to download the link with no problem. Using Firefox 8 however I the browser does not recognize the .pdf link's mime type. Instead of recognizing the download link as a .pdf file Firefox 8 tries to download it as "index.php". Firefox 8 does this with .doc files and .txt files as well. When I downgrade to 7.0.1 again the problem disappears.

    Hi hakmacpace,
    I'd try starting Firefox in [[Safe Mode]]. If you don't have the issue while all of your add-ons, extensions, and themes are disabled, you can try adding them back in one by one until you find the culprit. You should look at the [https://support.mozilla.org/en-US/kb/Troubleshooting-extensions-themes Extensions and Themes troubleshooting guide ] and the [[Troubleshooting plugins]] article as well.
    You could also try [https://support.mozilla.org/en-US/kb/Managing-profiles?s=create+a+new+profile&r=2&e=es&as=s#w_creating-a-profile Creating a new profile].
    Hopefully this helps!

  • Inbound Email Attachments with MIME type of application/octet-stream

    I'm hoping someone can help me here. I'm trying to start a BPEL process via email. The email can consist of no attachments or multiple attachments. All the attachments should be text, e.g. XML, CSV, etc.
    Where I have got to is receiving the email and writing the attachments to variables. All is fine until I get an attachment that has a MIME type of application/octet-stream. I would only expect to see this for files that are not text based.
    Does anyon know how I can inturpret this type so I can extract the text? In this example both files are text based although only the first file is displayed.
    <?xml version="1.0" encoding="UTF-8" ?>
    - <mailMessage xmlns="http://services.oracle.com/bpel/mail">
    - <from>
    <email>[email protected]</email>
    <displayName>James</displayName>
    </from>
    - <to>
    - <address>
    <email>j@james</email>
    <displayName>James</displayName>
    </address>
    </to>
    - <replyTo>
    <email>[email protected]</email>
    <displayName>James</displayName>
    </replyTo>
    <subject>RE: test</subject>
    <sentDate>2007-05-02T11:19:37.000+12:00</sentDate>
    <contentType>multipart/mixed; boundary="----_=_NextPart_001_01C78C47.6040C3F0"</contentType>
    - <content>
    - <multiPart>
    - <bodyPart>
    <contentType>text/plain; charset="iso-8859-1"</contentType>
    <content>________________________________ From: James [mailto:[email protected]] Sent: Tue 1/05/2007 3:05 PM To: James Subject: test</content>
    </bodyPart>
    - <bodyPart>
    <contentType>text/plain; name="create_MODS_schema.sql"</contentType>
    <content>CREATE USER TOLLBPEL IDENTIFIED BY VALUES 'TOLLBPEL' DEFAULT TABLESPACE APPS_TS_MODS_DATA TEMPORARY TABLESPACE TEMP PROFILE DEFAULT ACCOUNT UNLOCK; GRANT ANALYZE ANY TO MODS; GRANT CREATE TYPE TO MODS; GRANT CREATE TABLE TO MODS; GRANT ALTER SESSION TO MODS; GRANT QUERY REWRITE TO MODS; GRANT CREATE CLUSTER TO MODS; GRANT CREATE SESSION TO MODS; GRANT CREATE TRIGGER TO MODS; GRANT CREATE SEQUENCE TO MODS; GRANT CREATE SNAPSHOT TO MODS; GRANT DROP ANY OUTLINE TO MODS; GRANT ALTER ANY OUTLINE TO MODS; GRANT CREATE ANY OUTLINE TO MODS; GRANT CREATE DATABASE LINK TO MODS; GRANT CREATE PROCEDURE to MODS; ALTER USER MODS QUOTA UNLIMITED ON APPS_TS_MODS_DATA; ALTER USER MODS QUOTA UNLIMITED ON APPS_TS_MODS_IDX;</content>
    <bodyPartName>create_MODS_schema.sql</bodyPartName>
    </bodyPart>
    - <bodyPart>
    <contentType>application/octet-stream; name="citup.log"</contentType>
    <content>W0luc3RhbGxTaGllbGQgU2lsZW50XQ0KVmVyc2lvbj12NS4wMC4wMDANCkZpbGU9TG9nIEZpbGUNCltSZXNwb25zZVJlc3VsdF0NClJlc3VsdENvZGU9LTEyDQo=</content>
    </bodyPart>
    </multiPart>
    </content>
    </mailMessage>
    Any help will be appreciated.
    cheers
    James

    I'm hoping someone can help me here. I'm trying to start a BPEL process via email. The email can consist of no attachments or multiple attachments. All the attachments should be text, e.g. XML, CSV, etc.
    Where I have got to is receiving the email and writing the attachments to variables. All is fine until I get an attachment that has a MIME type of application/octet-stream. I would only expect to see this for files that are not text based.
    Does anyon know how I can inturpret this type so I can extract the text? In this example both files are text based although only the first file is displayed.
    <?xml version="1.0" encoding="UTF-8" ?>
    - <mailMessage xmlns="http://services.oracle.com/bpel/mail">
    - <from>
    <email>[email protected]</email>
    <displayName>James</displayName>
    </from>
    - <to>
    - <address>
    <email>j@james</email>
    <displayName>James</displayName>
    </address>
    </to>
    - <replyTo>
    <email>[email protected]</email>
    <displayName>James</displayName>
    </replyTo>
    <subject>RE: test</subject>
    <sentDate>2007-05-02T11:19:37.000+12:00</sentDate>
    <contentType>multipart/mixed; boundary="----_=_NextPart_001_01C78C47.6040C3F0"</contentType>
    - <content>
    - <multiPart>
    - <bodyPart>
    <contentType>text/plain; charset="iso-8859-1"</contentType>
    <content>________________________________ From: James [mailto:[email protected]] Sent: Tue 1/05/2007 3:05 PM To: James Subject: test</content>
    </bodyPart>
    - <bodyPart>
    <contentType>text/plain; name="create_MODS_schema.sql"</contentType>
    <content>CREATE USER TOLLBPEL IDENTIFIED BY VALUES 'TOLLBPEL' DEFAULT TABLESPACE APPS_TS_MODS_DATA TEMPORARY TABLESPACE TEMP PROFILE DEFAULT ACCOUNT UNLOCK; GRANT ANALYZE ANY TO MODS; GRANT CREATE TYPE TO MODS; GRANT CREATE TABLE TO MODS; GRANT ALTER SESSION TO MODS; GRANT QUERY REWRITE TO MODS; GRANT CREATE CLUSTER TO MODS; GRANT CREATE SESSION TO MODS; GRANT CREATE TRIGGER TO MODS; GRANT CREATE SEQUENCE TO MODS; GRANT CREATE SNAPSHOT TO MODS; GRANT DROP ANY OUTLINE TO MODS; GRANT ALTER ANY OUTLINE TO MODS; GRANT CREATE ANY OUTLINE TO MODS; GRANT CREATE DATABASE LINK TO MODS; GRANT CREATE PROCEDURE to MODS; ALTER USER MODS QUOTA UNLIMITED ON APPS_TS_MODS_DATA; ALTER USER MODS QUOTA UNLIMITED ON APPS_TS_MODS_IDX;</content>
    <bodyPartName>create_MODS_schema.sql</bodyPartName>
    </bodyPart>
    - <bodyPart>
    <contentType>application/octet-stream; name="citup.log"</contentType>
    <content>W0luc3RhbGxTaGllbGQgU2lsZW50XQ0KVmVyc2lvbj12NS4wMC4wMDANCkZpbGU9TG9nIEZpbGUNCltSZXNwb25zZVJlc3VsdF0NClJlc3VsdENvZGU9LTEyDQo=</content>
    </bodyPart>
    </multiPart>
    </content>
    </mailMessage>
    Any help will be appreciated.
    cheers
    James

  • Mime-type and/or extension of script file

    I would like to generate a script file dynamically on my web server and then have it downloaded to my users such that they can simply double-click the file and have it execute. I've gotten pretty close by using the ".command" extension, but it still requires a "chmod +x filename" after download in order to work properly. Is there another extension or a mime-type that I could use that would cause Mac OS X 10.4 and/or 10.5 to grant execute rights to the user that downloaded it? I'm not married to it being shell script if it can be done with AppleScript, Ruby, etc that would be great. It basically just has to be text file (non-binary format) so I can dynamically generate it on the server side.

    Hi Daniel,
    do you use EPG, mod_plsql or APEX Listener? Have you changed the connection mechanism after upgrading to 4.2.1?
    If you use the APEX Listener, which version do you use? Which browser and version do you use to upload the file? Does it reproduce with other browsers as well?
    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

  • How to get at a mail of MIME type application/vnd.ms-excel?

    My java proggie has to deal with an email sent with Outlook '97 (don't ask me why it has to be that) and this email has the following header fields (see below). Now, my program works fine if the email has MIME type multipart/mixed. So, how do I have to do to handle an email of MIME type application/vnd.ms-excel (outline of logic or even some code snippet will be greatly appreciated)?
    Received: by chk_exchange6.whatever.local
         id <01C83718.A96E9AC0@chk_exchange6.whatever.local>; Wed, 5 Dec 2007 16:27:24 +0800
    Message-ID: <E839E45C64CF7E4D9E4E8A334B79363001F0DB62@chk_exchange6.whatever.local>
    From: "somebody" <[email protected]>
    To: "me" <[email protected]>
    Subject: excel attached
    Date: Wed, 5 Dec 2007 16:27:24 +0800
    MIME-Version: 1.0
    Content-Type: application/vnd.ms-excel;
         name="nevermind.xls"
    Content-Transfer-Encoding: base64
    Content-Disposition: attachment;
         filename="nevermind.xls"
    Edited by: dickensl on Dec 5, 2007 11:47 PM

    Depends on what you want to do with it.
    If you want to access the data in the Excel spreadsheet
    and make sense of it, you're going to need some
    Java classes to interpret an Excel spreadsheet.
    Good luck on that. :-)
    If you just want to save the content in a file, as if it
    were an attachment, use msg.getInputStream()
    and copy the data to a file, like this:
            OutputStream out = null;
            InputStream in = null;
            try {
                out = new BufferedOutputStream(new FileOutputStream(file));
                in = msg.getInputStream();
                byte[] buf = new byte[8192];
                int len;
                while ((len = in.read(buf)) > 0)
                    out.write(buf, 0, len);
            } finally {
                // close streams, but don't mask original exception, if any
                try {
                    if (in != null)
                        in.close();
                } catch (IOException ex) { }
                try {
                    if (out != null)
                        out.close();
                } catch (IOException ex) { }
            }

  • Safari doesn't display an object with MIME type video/mp4

    So, I've got a little hiccup here. I put together a CV in html with samples you can click to bring up. Now, I don't make any claims to professional geekdom, but I try to be fairly html savvy, and since I'm sending this to the college IT guys, I want to do it right. So I'd like this thing to use valid w3c compliant html. Not too tough, fix some missing quotes and learn how to use the object tag instead of embed. Done.
    Well, here's the problem. I loaded it into Safari for testing, and a Quicktime file won't play. Now, it runs fine on Firefox. The obtuse and awkwardly lumped in IE version of the object works fine (tested in IE6, Win2K virtual machine). And the same file ran fine when I had it using an embed tag. Now it just brings up the Quicktime emblem, takes up the specified amount of space, and doesn't do anything.
    What did I do wrong? I've got the latest Quicktime and Safari, and I know it's standards compliant. Do I have to feed it some more specific type for an h.264 encoded mp4?
    Here's the code I used. The embed tag is the one that works, the object tag is the compliant one that doesn't. I'm guessing I'm missing a parameter or something. Any advice?
    <embed scale="1" src="files/Sabres.mp4" pluginspage="http://www.apple.com/quicktime/download/" autoplay="FALSE" volume="100" cache="TRUE" height="496" width="640">
    <object type="video/mp4" data="files/Sabres.mp4" height="496" width="640">
    <param name="controller" value="true">
    <param name="autoplay" value="false">
    Your browser cannot display this content. Click here to download it.
    </object>

    Tom and Kirk, thanks for your time. That would work, but since <embed> is a non-standard tag, I want to avoid it.
    Andy, I actually stopped by that site last night, and I did use it for the object code.
    My problem is that for some reason, what looks like a legitimate implementation of <object> isn't displaying in Safari. I know Firefox is a bit more forgiving of sloppy code, so I don't blame Safari for that one. I know Safari can display the file because it displayed it properly when I called it with embed. I'm just not sure what's wrong with the code that's making Safari not bring up the video. It knows it's Quicktime and loads the file, I know that, because it brings up the emblem and starts hoarding RAM when I bring it up in Safari, but it just holds there. I've tried a couple MIME types, including video/quicktime and video/mp4, both worked in Firefox, and video/h264 just as a shot in the dark, and both Safari and Firefox showed the alternate content.
    By the way, here's the full code I used to display the object, using Castro's cloaking technique for IE compatibility. I omitted it earlier because when I isolated the non-IE section alone in the body of the document it behaved the same as it did with the cloaking (working in FF, broken in Safari).
    <!--[if IE]>
    <object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="496" width="640">
    <param name="src" value="files/Sabres.mp4" >
    <param name="controller" value="true">
    <param name="autoplay" value="false">
    </object>
    <![endif]-->
    <!--[if !IE]> <!-->
    <object type="video/mp4" data="files/Sabres.mp4" height="496" width="640">
    <param name="controller" value="true">
    <param name="autoplay" value="false">
    Your browser cannot display this content. Click here to download it.
    </object>
    <!--<![endif]-->
    Message was edited by: The Spine

Maybe you are looking for

  • Problem with wireless printer HP photosmart by using iPad

    How can I use my wireless printer HP photosmart D 7460 with my iPad? jacques

  • Scenario Mail to Idoc with many Attachment.

    Hello,          I have a **Mail to Idoc** Scenario. The Mail that I receive contains 3 attachment in XI.          Please let me know how to configure this sender mail adapter to capture all the attachment and send them to the BPM.          I have see

  • ? iPad Wi-Fi Problem

    I am having problems connecting to my home Wi-Fi. I have tried turning the device off and also renewing th lease as suggested in one of the blogs. None of these are working. Please help

  • Some people are unable to view my movie on my web page

    I published a short movie on my web page. Some people are able to view the movie; however, others cannot view the movie at all. I thought that everyone would be able to view the movie once I put it on my web page. I don't understand why some can see

  • ASA failover is not replicating configuration

    Hi: I discover an issue with my CISCO ASA 5550 because I'm looking at the vlans that I have configured and some vlans on the Stand by device had not an IP address configured, checking the configuration of the failover I don't see anything wrong so I