MIME type problem in version 4.1/4.2 Compatibility Mode

Problem: when you view a PDF file, it displays OK in PDF if APEX 'Compatibility Mode' = ' 4.1 Pre', but displays in HTML mode ' 4.1 ' or '4.2 '. ""

Apex: 4.2.2.00.11

DB: 11 GR 2

Web server: Apache on Linux

More detailed description... This seems to be a MIME type problem with APEX (or maybe DB) release management.  The following code works as expected when run in mode ' 4.1 Pre'-IE.» It displays a PDF document in Acrobat appropriate / another plugin in several browsers (Firefox, Opera, Chrome, IE).  But just by changing 'Compatibility Mode' TI ' 4.2 "(ou encore «4.1"), then download the file but it appears like a bunch of random characters, and the web page header type MIME is "text/HTML". "."

Note: this also happens with other types of files such as doc/xls/etc, but I would expect pricing PDF should also fix these.

I'm a bit of a loss as to where this is the case, it seems that there is a difference in "Compatibility Modes" between the creation of the header HTML using "OWA_UTIL.mime_header" or the path of the component it goes through before coming to apache.

The only other thing I could think is that we do a little redirection to display the PDF file, although it seems like it might be a Kipper.  Basically, we use page 560 as a container and then view the PDF with page 561 in an embeded frame within page 560.  So we have, on page 560, which is the one that we reference throughout the application, 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 process "We charge - before header", we call 'DOWNLOAD_APPLICANT_PDF' code (below).

Note: I tried to call "apex_application.stop_apex_engine" after "DOWNLOAD_APPLICANT_PDF", as suggested by a few threads, but it does not solve the problem and caused some 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)

IN lob_loc, v_length

OF 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 = "mondoc.pdf" ');

OWA_UTIL.http_header_close;

WPG_DOCLOAD.download_file (lob_loc);

END;

< / pre >

Found the solution and quite painfully simple... just need to make the following call before defining the HTML header information:

HTP.init;

(oh and thanks to Salvatore to find cela)

Tags: Database

Similar Questions

  • SE MIME type problem

    Hello

    I use class in Flash FileReference to download a file with a ColdFusion page. I use the cffile tag in coldfusion and I can determine what files will be accepted with 'accept' argument. But Flash is sending as application/octet-stream content type always! It is not safe to watch the extension only. It is therefore misleading to coldfusion!   Is there a solution to this issue?

    Help, please. Thank you.

    Flash always uses the MIME type of the octect stream whatever the file is transferred.  You should not rely on the MIME type or accept attribute of CFFILE to safety.  The MIME type is set by the client to submit the file.  A malicious user could drop a CFM file with a different MIME type and bypass the safety devices that rely on the verification of the MIME types.  You should check the file extension and/or the content of the file on the server side.

    Pete Frietag has a good blog on download file security.

    http://www.petefreitag.com/item/701.cfm

  • On Firefox only, I get problems with a few Joomla sites using the JA_purity template. Error: has not been loaded because its MIME type "text/html", is not "text /".

    Hello

    I updated Firefox on my computer for 13.01. Now, he struggles to read about 2 sites - both are Joomla and based on the model of JA-purity. What happens is that it fails to load the CSS files to do with the side and the top of the Joomla site menus. The file comes up with this:

    because its MIME type "text/html", is not "text/css".
    Source file: http://extensions.joomla.org/
    Line: 0

    This error does not appear with other browsers and it displays perfectly in fact in all other browsers.

    I'm new on this but I read the following article and think it could be my problem

    https://developer.Mozilla.org/en/Incorrect_MIME_Type_for_CSS_Files

    Where Im stuck, it's that I did not fully understand what to make of this article, if I could get a step by step guide to fix this problem that would be greatly appreciated.

    I apologize in advance if the answer lies somewhere here - I have had a look and couldn't get out.

    Thank you
    Alex

    I don't see that the error and all style sheets seem to load.

    Reload Web pages, and ignore the cache.

    • Hold SHIFT and click reload.
    • Press 'Ctrl + F5' or 'Ctrl + Shift + R' (Windows, Linux)
    • Press 'Cmd + Shift + R' (MAC)

    Clear the cache and cookies from sites that cause problems.

    "Clear the Cache":

    • Tools > Options > advanced > network > storage (Cache) offline: 'clear now '.

    'Delete Cookies' sites causing problems:

    • Tools > Options > privacy > Cookies: "show the Cookies".
  • How to solve the problem of "MIME types"!

    Hello!

    How solve the problem of the "MIME Types", Windows does not keep the default applications!

    When I try the default application (e.g. right-click on. PSD files and 'open with'), then I have valid selection program (Photoshop.exe), it does not appear in the selection of the default programs in windows!

    Result, dynamic objects even more open in my apps and all the icon of adobe files do not appear in Explorer

    THX

    I have a solution that works for me (Win7 64 bit)!

    Use a cleaner (ccleaner) registry and kill the old entry file format !

    Now restart association with one. HAVE file, because the .exe is in another place like the other apps!

    Try this:

    • First, right click on your icon illustrator apps (desktop or the start menu) and choose "Open file location" and copy the directory ("C:\Program Files\Adobe\Adobe Illustrator CC 2014\Support Files\Contents\Windows" for me)
    • Click right on your. HAVE file and select 'Open with', now click on 'Browse' "C:\Program Files\Adobe\Adobe Illustrator CC 2014\Support Files\Contents\Windows" for the 64-bit system.
    • 'Windows' say 'you have problem with registry file association' send your of the correction and the illustrator icon appear in the list of default applications.
    • Select and validate him

    Now, do the same thing for all your 'unknown file type' with good apps!

  • Downloading a file, application/octet-stream mime type, I always get the dialog box "do you want to save to save this file?" Cancel or save.

    A number of us use a private site where run us an application in offline mode. The application offers a download button so that we can take a snapshot of our progress in offline mode, a sort of backup. When we'll be back online you can either download the information from the application or we can load the backup files.

    The problem is that every time we hit the download button, we always get the additional dialog box asking if we want to save or cancel the download of the file. It may sound a little silly, but we really do not want to have to move the mouse to the new dialog box and click on the "Save" button.

    The mime type of the file is application/octet-stream, there is no file extension.

    Is there a way to change the configuration of Firefox so that this dialog box does not appear?

    Thank you.

    My apologies, but I deleted all system information collected automatically because I am not in a position to submit this application for machines where the problem occurs.

    These system are:
    14:04.3 Ubuntu LTS
    Firefox 40.0.3

    Content of type "application/octet-stream" will cause always Firefox show the 'open with' Download dialogue.
    To avoid this download, you must configure the server to send another type of content and possibly change the file extension.

  • restriction of cffileupload mime type?

    Hello

    I'm trying to implement the cffileupload widget and restrict to only be able to download image files

    you don't need an extension filter that can be defined on *.jpg, *.png etc... but the user can still select other types of files using the *. * command in the context menu of Explorer

    so I thought about restricting on the real cffile 'upload' tag in the backend, but all the files have the mime type "application/octet-stream" and not image/jpg...

    no idea how really limiting this tag?

    Maybe it is related to this issue

    http://www.elliottsprehn.com/cfbugs/bugs/81254

    TX

    You should check the cffile. Variable ServerFileExt that contains the extension of file for you ensure that it matches your set of allowed extensions. Make sure you download in a folder outside the root Web (for example getTempDirectory()) first to avoid potential security problems.

    You can also use IsImageFile() in addition to the test of file extension, but don't count on isImageFile (always check file extensions).

    If you have CF10 you can use as well.

    In short - don't count on the mime type for what, whether it can be spoofed by an attacker to upload malicious files, always check the file extension (merit to be repeated).

    -Pete Freitag

    Foundeo Inc. - manufacturers of HackMyCF & FuseGuard

  • Why is Win XP Pro SP3 computer get error 'no video with format supported or a MIME type found.

    I have a Windows XP Pro SP3 computer, and I get the error 'No video with format supported or a MIME type found.' When I try to watch videos in the browser. I used to be able to view the videos, but 3 months ago they stopped working and I started to receive the above error message. What could be the cause for it? Thanks a lot for your time and help! God bless you!

    Daffodil5 said

    The site "paperwishes.com" (card making supplies) plays videos of product for some of its products. A blue box shows the word 'Play' next to the item. When I clicked on this blue box last spring, he'd always play. He's now hit & miss. Sometimes, it will offer to play via MP4, but rarely. Their 'webisode' will play not (who played in the spring, as well). Cannot understand what has changed: Google update leaving Windows XP in the past?

    Videos on the site can be read with an HTML5 player and do not use the Flash Player Plugin like a video I cheacked used HTML5 player when I right click on it. Actually, it turns out the link video was a Youtube video and YT uses the HTML5 player when possible and descends to Flash Player if need be if they always support such.

    With a little work, you can get the video to work in Firefox on the old WinXP EOL of HTML5.

    http://www.MSFN.org/Board/topic/175591-enable-MP4-h264-AAC-HTML5-video-in-Firefox-on-Windows-XP-without-Flash/

  • Detect if a file is a supported mime type

    When you browse through a list of files how can I better check if they are of a mime type supported for the media player?

    I found this list which describes mime supported for different device types.

    http://supportforums.BlackBerry.com/T5/Java-development/supported-audio-formats/Ta-p/445064

    How do better type of mime of a file?

    If you do support BlackBerry OS 4.3.0 and more you can use the following package:

    javax.microedition.Content

    Mark said the Mime type is sent from the web server.

    Example Code:

    Registry registry = Registry.getRegistry(...);
    ContentHandler[] contentHandlers = registry.forType(MIME_TYPE_STRING);
    
    loop through the  content handlers and check for contentHandlers[i].getAppName()
    You will need to find out what the media player name is.
    

    Hope this is what you are looking for.

  • Detects the MIME type of the file

    Hello

    Is it possible to get the MIME type of the file extension or content?

    Thank you

    Seems that I found the solution: passing NULL as the MIME type when creating an attachment

    Attachment(NULL, attachmentName, attachmentUrl)
    
  • MIME types

    I recorded the "application/x-chess-pgn" mime type in my folder bar, but still "can't open the file" in the browser, when you try to open a file PGN. How will I know what mime types are defined?

    and the client of wgere you want to open the app provides the mime type?

    or only the URI without mime-type?

    then try to define another filter providing the file suffixes that support you

    BTW: use Client Invocation of Cascades - samples to Github to try different queries - then you can easily check if your APP is listed as target

  • BrowserPlugin works Simulator, but the device does not recognize the mime type

    Hello world

    Use the BrowserPlugin class in JDE samples, I was able to record a personalized with my BlackBerry mime type. When the browser makes a redirect to a specific page with the mimetype, the browser will recognize and use getBrowserContent() to move my application to the foreground, above the BlackBerry browser.

    I have this working on the Simulator, but on the device, I get the message: "unable to display the selected item. You want to save the item? »

    When I click 'No', I get the message: "Unsupported media type: application/x-vnd.rim.xxxtest.

    Like I said before, it works on the Simulator. I supported by the web server mime type, and I created a library project that will run at startup that will record the mime with the device type.

    I've debugged on my real device and confirmed that my library project is actually the launch...

    Someone know why this might work on the Simulator, but not on the device?

    Ah,.

    I'm embarrassed. I had unconsciously assume that when I used Javaloader to load my application to my phone that it would also include the referenced library projects... I was wrong!

    I loaded the library project separately and it works very well.

  • Graphic problems and version of storm

    Hello

    So I am writing an application that will eventually be used on the BlackBerry. I designed originally for the program to work for "BOLD" and now I create a version of the storm. I used the IDE 4.6 for the "BOLD", and now that I'm working on the storm I use IDE 4.7.

    So, here's the problem, when I try to use the version in bold on the storm, I get these problems:
    1. a blue border around the entire screen

    2. the keyboard is still showing, and the menu does not appear the options hide/show keyboard

    3. you must scroll to select anything on the screen instead of being able to use the touch screen to jump around different buttons

    So when I compiled my code in 4.7 and he ran on my blackberry storm, all of these issues have been fixed and it worked perfectly. After a few changes, unrelated to the graphics, when I put the same program on my phone, he returned to the old graphical version "BOLD" with all of these problems. It worked perfectly an hour previously, if it is not a question of any abusive use in the graph code that I wrote.

    Now, I already checked to make sure that I download the version of the storm that I created several times. I know I do signatures correctly and to download properly for the version of the storm. I want his problem with the way the program is being built. Sometimes, he chooses to build for phones of the world edition "BOLD" and recently she correctly built for the storm.

    Is there a way maybe tell what version to use in the application, so it gets built correctly? Any other ideas why he uses the "BOLD" settings on the storm? Thanks guys 1 million.

    EDIT: Just a side note, the Simulator works perfect every time. Its when I put it on the phone is when it seems incorrect.

    I've had instances where I loaded the wrong construction on the storm (resulting in execution 'compatibility mode') and then replaced with the correct version, to see the storm always treated the program as if it was built on the earlier operating system. Apparently, it sets an internal flag that says 'this program is running in compatibility mode', but never it clears.

    Finally I had to disable the compatibility mode on the phone for my program. This can be done in the Options program.

    See this link:

    http://supportforums.BlackBerry.com/Rim/Board/message?board.ID=java_dev&message.ID=10655&query.ID=36...

  • Startup applications with the mime type or file-name extension

    Hello

    is it possible to start the corresponding application for a mime-type file or a file extention? I have for example a JPEG image or PDF file stored on the SD card and wants to open by calling the assosiated on the BlackBerry Smartphone application.

    Lars

    Ok. I've got so far. But how do I know which deals with the application for example .jpg or .pdf? I found the registry as the place of registry types mime and file-extensions for a particular application, but could find no way to recover this information with other applications from there. Any idea?

    Lars

  • MIME type of SMS

    I am trying to send an SMS with a support of binary data.

    I tried to set the MIME type to applicaion/vnd.blackberry.sms but I am getting an invalid attachment and the SMS is not sent.

    If I change the MIME "text/plain" SMS type gets sent, but not with the QDataByteArray.

    If there is a MIME type should I use?

    Thank you.

    The MIME Type is

    Attachment attachment (' application/octet-stream', ' application/octet-stream', data);

    but this works on 10.1 from.

  • Consignment of filter for MIME type

    Hello

    I need to check the mime type of the file (no extensions, but the mime type of the file header) before save you the file in the WCC. The mime type must be checked the content of the file (header) so that the file extension will not deceive the system.

    I wrote the checkin filter, but am stuck at the time to read the contents of the file and determine the mime type. Any ideas how this can be achieved?

    Concerning

    Amey Maratha

    Two components contain the same Java class and there is a conflict that must be resolved.

    You can try changing tika-app - 1.5.jar and the abolishment of the class in question.

    Jonathan

    http://jonathanhult.com

Maybe you are looking for

  • HP LaserJet 8500 a: printer8500A question

    You have a problem with my HP 8500.  Has got very slow or most of the time not printing at all.  Get the message to align the print head and did and still see her fail to align with it.   and continue to test every time print but no impression of the

  • UCS C240 M3 "hard drive not found."

    Hello world. I have a UCS C240 M3 for a demo with the following equipment. UCS C240 M3 SFF2 1x8GB 1xE5-2609 ROM55 2x650W SD RAILS SMARTNET 8X5XNBD UCS C240 M3 S2 Server-SFF E5-2609/80W 4 c/10 MB of 2.4 GHz Cache/DDR3 1066 MHz Rank of 8 GB DDR3-1600-M

  • BlackBerry Smartphones Internet Email Synch Issue (?)

    Hello.  I currently have a 8820 through my company and it works Enterprise Server business.  I also have a couple of personal e-mail accounts set up at this topic through the phone, including a yahoo email account, plus a local Internet service provi

  • Installation of CS4 on Windows 8.1 Setup error

    Thus, after having quite quite annoyed at this, I ask the question:How can I fix the error "the installer has encountered an error and cannot continue" when installing with windows 8.1Details of things, I've tried and knowThen, new installation of Wi

  • Extend VMFS to 4, 1 TB

    In my VMWare environment, I created a LUN 4, 1 TB with VMFS 3.46 and a 8MB block size. When the logical unit number is created the VMFS volume is can only claim 102,25 GB instead of 4, 1 to. After that I have tried to increase the size, but I get the