How are Static File mime types determined?

How does APEX determine the mime type for imported static files?
We have a number of javascript files in our application, some of which are listed on the Static Files page as "text/html" and some are "text/plain". But some are imported as "application/octet-stream" which prevents them from being edited within APEX.
All of these files contain plain text javascript functions.
File sizes range from 539 bytes to 21251 bytes
We tried changing the extensions from ".js" to ".jscript" and reimported them. They were all given a mime type of "text/plain". But one file was misnamed with the extension ".jsript", so we deleted it, changed the extension to ".jscript" and re-imported it. It was imported as "application/octet-stream" even though it was exactly the same file just renamed!
What's going on?

I am trying to use a rather older programming language called Mozart, an extension of OZ. I installed it as a binary, but instead of storing its component binaries in a place like /usr/local/oz/bin/. they are all enclosed inside the /Applications/Mozart.app/Contents/Resources/bin/. which cannot be opened nor can a soft link be made to it located outside the Mozart.app wrapper.
The only alternative is to try to edit the mimeTypes.rdf files, and give it the full path name to the inside of Mozart.app were the program used for web applications is stored. It is stored in ~/Library/Application Support/Mozart/, which can only be accessed in more recent Mac OS X by going to finder and holding the Option key while opening the Go menu; this will make the ~/Library visible and accessible.

Similar Messages

  • How to get the MIME type of the given file in R/3

    Dear Experts,
    Please tell me the FM or Class to get the given file MIME type in R/3 . I am using GUI_upload Function module to upload the file in R/3 .
    Edited by: balaji ramadas on Jan 16, 2009 5:39 AM

    Thank you Prosenjit I m using this FM   CV120_GET_MIME_TYPE
    to get the MIME type of the file
    regards,
    Balaji.R
    Edited by: balaji ramadas on Jan 19, 2009 9:24 AM

  • Get Uploaded File Mime Type and Client Filename

    Anyone know how to recover an uploaded file MIME type and
    client file name?
    I'm writing my own cfx tag to process file uploads and pretty
    much have it figured out except to determine the name of the client
    file and mime type. The formfield file variable value contains the
    path/filename to the CF temp directory, but I need the MIME type,
    filename, etc. that is contained int he HTTP Header
    (e.g. Content-Disposition: form-data; name="Image";
    filename="C:\test.JPG"
    Content-Type: image/pjpeg
    [empty line])
    I'm using the getHttpRequestData() functiont, but it only
    gives me the content-type multipart/form-data, leaving out the Mime
    type and Content-Disposition (which contains the client file name).

    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

  • [CLOSED] Graphical file/mime type association editor?

    Is anyone aware of a general-purpose (i.e. not belonging necessarily to one of the major DEs) file/mime type association editor? I'd like to be able to change the default applications of a given file-type independently of the DE. In particular, I'd like to know how to set a default file manager.
    Last edited by nbtrap (2011-10-31 19:39:10)

    It doesn't look like there is a desktop-independent GUI for editing filetype associations. As far as I now understand, the concept itself it practically meaningless since DEs that conform to xdg standards have their own sets of associations. At any rate, the xdg-* tools are actually quite easy to work with. And I don't see any difference between mimeo and xdg-open. Thank you both for your help.

  • Determine file MIME types

    How can I determine the mime type of a file dynamically?
    I have created a simple servlet to help download files,
    but I need to set the content type dynamically
    (currently I have it hard-coded).
    Any suggestions?

    Okay! so I added the following code and now I get a NullPointerException on the setContentType method of the HttpServletRequest, because getContentTypeFor is returning null. Any ideas? see code ...
    <code>
    File file = new File( extendedPath + fileNm );
    // new code to get content type (also tried with file.getAbsolutePath() )
    String contentType = URLConnection.getFileNameMap().getContentTypeFor( file.getName() );
    response.setContentType( contentType );
    </code>

  • How to get the Mime Type of the file?

    Hi Everyone!,
    I want to upload a random file into my table as a BLOB and simultaneously want to fill the respective another column with its MimeType. Earlier I used Oracle Apex for this, but due to my new requirement I need to make this happen with the help of PL SQL and Forms. Could you help me in getting how we can upload the file and most importantly, how we can get its Mime-Type.
    My chosen file can be of any type; it can be doc ,pdf,txt,xls ,gif or any other format.
    If you could provide the example with your reply then it would be great.
    Thanks
    Harbinder

    hi
    for that u have to use webutil.
    declare
          f varchar2(100);
    begin
         f := webutil_file.file_open_dialog();
         if f is not null then
              :doc.doc_name := f;
              end if;
         end;and
         DECLARE
    filename VARCHAR2(256);
    BEGIN
    filename := CLIENT_GET_FILE_NAME (File_Filter => 'jpg (*.jpg)|*.*|');
    READ_IMAGE_FILE(filename, 'jpg', 'image');
    END; sarah

  • How to get the 'mime-type' of a Resource accessed via WebDAV

    Hello,
    When a document is uploaded into a folder which is managed by a WebDAV RepositoryManager we don't see a Property 'mime-type' or something like that.
    Our code:
    <i>IPropertyMap lijstProp = tempResource.getProperties();</i>
    In the list there is no Property 'contenttype' or something like that!
    This is a bit of a surprise to me since it seems to me a very relevant Property of a Resource.
    How can the mime-type/contenttype of a Resource managed by a WebDAV Repository Manager be determined?
    Kind regards,
    Maarten Rutten

    Hi Thilo,
    We access the Resources via API.
    When I use "IPropertyMap lijstProp = tempResource.getProperties();" I assume that ALL the available properties are in 'lijstProp'.
    (is this correct?)
    I don't have the Property "contenttype" available in 'lijstProp'.
    A workaround could be that when adding documents to a folder via API's, we also should set this Property via API's.
    But when documents are added directly into the WebDAV folder we don't have that option. So, when we find a Resource with the Property 'contenttype' missing the only option I see is to 'calculate' the contenttyype based on the extension of the Resource.
    Do you agree?
    Kind regards,
    Maarten

  • How to filter with mime types

    Again thanks for the help getting up and running.
    Now that I am up and running I know my task at hand and I have comleted most of it except for a couple of things. Here is my task:
    To have 1 URL filter lists. Lets call it WhiteList-special. What my manager wants is this.
    To all URL's matching the WhiteList-special filter allow the connections filtering out a set of mime types.
    To all URL's not in the WhiteList (still allow them them) but apply a different set of mime type restrictions.
    How can I go about doing this? Do I use the http:// resource and set up the whitelist-special there with a mime list and then in default set up an allow list of basically .* with a different mime type list ??
    Also I noticed that in the mime.types file gnu zip (.gz) was listed as an encoding and not application. Thus if I include the gz mime type in my <Filter "filter-ct" ...> line the gz seems to be ignored. I block all other mime types that are of the application type but I cannot block any encoding type. Am I doing something wrong?
    thanks
    Doug

    Here is what you can do:
    (the simplest way)
    Use a filter that will add a variable to all the mime-types that you want to whitelist.
    Then use a filter to deny all the other types. In the below code, the identity filter is the one that you can use to touch all the whitelist -- (below, it only allows text/plain), and the deny filter will deny all the rest.
    To your question on content-type, check how the content-length is obtained in the below code.
    -------obj.conf------------
    <Object ppath="http://.*">
    ObjectType fn="cache-enable" query-maxlen="10" log-report="off"
    ObjectType fn="cache-setting" lm-factor="0.10" max-uncheck="7200"
    Output fn="insert-filter" type="text/plain" filter="identityfilter"
    Output fn="insert-filter" type="*" filter="denyfilter"
    Service fn="proxy-retrieve" method="*"
    </Object>
    |cat identityfilter.c
    * Usage:
    *     At the end of magnus.conf:
    *         Init fn="load-modules"
    *              shlib="<path>/identityfilter.<ext>"
    *              NativeThread="no"
    *     Inside an object in obj.conf:
    *         Output fn="insert-filter"
    *                type="text/*"
    *                filter="identityfilter"
    #include "nsapi.h"
    int identityfilter_insert(FilterLayer *layer, pblock *pb) {
        pblock_nninsert("identityfilter", 1, layer->context->rq->vars);
        return REQ_PROCEED;
    void identityfilter_remove(FilterLayer *layer) {
    int identityfilter_write(FilterLayer *layer, const void *buf, int amount) {
        return net_write(layer->lower, buf , amount);
    NSAPI_PUBLIC int nsapi_module_init(pblock *pb, Session *sn, Request *rq) {
        FilterMethods methods = FILTER_METHODS_INITIALIZER;
        methods.insert = &identityfilter_insert;
        methods.remove = &identityfilter_remove;
        methods.write = &identityfilter_write;
        const Filter *filter = filter_create("identityfilter", FILTER_CONTENT_TRANSLATION, &methods);
        return REQ_PROCEED;
    |cat denyfilter.c
    * Usage:
    *     At the end of magnus.conf:
    *         Init fn="load-modules"
    *              shlib="<path>/denyfilter.<ext>"
    *              NativeThread="no"
    *     Inside an object in obj.conf:
    *         Output fn="insert-filter"
    *                type="text/*"
    *                filter="denyfilter"
    #include "nsapi.h"
    int denyfilter_insert(FilterLayer *layer, pblock *pb) {
        char* processed = pblock_findval("identityfilter", layer->context->rq->vars);
        if (!processed) {
            pb_param *pp = pblock_remove("content-length", layer->context->rq->srvhdrs);
            if (pp) param_free(pp);
            layer->context->data = (void*)1;
            Request* rq = layer->context->rq;
            rq->status_num = 403;
            pp = pblock_remove("status", rq->srvhdrs);
            if (pp) param_free(pp);
            pblock_nvinsert("status", "403", rq->srvhdrs);
        } else {
            layer->context->data = (void*)0;
        return REQ_PROCEED;
    void denyfilter_remove(FilterLayer *layer) {
    int denyfilter_write(FilterLayer *layer, const void *buf, int amount) {
        if ( layer->context->data ) return IO_ERROR;
        else return net_write(layer->lower, buf, amount);
    NSAPI_PUBLIC int nsapi_module_init(pblock *pb, Session *sn, Request *rq) {
        FilterMethods methods = FILTER_METHODS_INITIALIZER;
        methods.insert = &denyfilter_insert;
        methods.remove = &denyfilter_remove;
        methods.write = &denyfilter_write;
        const Filter *filter = filter_create("denyfilter", FILTER_CONTENT_TRANSLATION, &methods);
        return REQ_PROCEED;
    -----------------------------------What is my best approach? Can I simply call another Filter from mine?
    check out func_exec and friends in nsapi.

  • Uploading files Mime Type not correct for Office 2007 default extensions.

    hi all,
    My company has recently moved over to MS Office 2007 and the default extensions for word, excel etc are now .docx, xlsx etc (ie xml based).
    Unfortunately now when we upload files through APEX to the database the MIME TYPE value for these files isn't being recognised and not loadeding correctly into the APEX_APPLICATION_FILES table and subsequently any future retrieval of these files fails.
    I could put some logic inthe up load procedure to look at the filename in APEX_APPLICATION_FILES and hard code in the releavnt mime types but this still causes problems when retrieving the content.
    Has anyone come across this and got a workround? Is it a bug in AE?
    regards
    James
    FYI - using APEX 3.0.2 over 11G.

    I have not any response to my question and not sure if it is in Apex I need to look or the tomcat server that I need to look. I have a useful application to try to show others what Apex can do for our customers to collaborate. However, most of our customers are using office 2007 so, hoping this is possible.
    I am using apex 3.2.0.00.27 if that helps someone to point me where to find more info on being able to have Word 2007 or excel 2007 fire up to open a .docx or .xlss file stored in a table blob column. Word or Excel does fire up to open .doc and .xls files.
    The following is the query for a report selecting the filenames uploaded into a blob column in my table:
    { SELECT s.ID, SUBSTR(s.NAME,INSTR(s.NAME, '/',1,1)+1,length(s.NAME)) SHORT_FNAME, s.SUBJECT
    FROM spp_attachments s
    WHERE s.PROGRAM_ID = :P2_PROGRAMID }
    Below is the stored procedure called from the link on the short_fname column in report query above.
    { create or replace PROCEDURE  download_file(p_file IN number) AS
    v_mime VARCHAR2(48);
    v_length NUMBER;
    v_file_name VARCHAR2(2000);
    Lob_loc BLOB;
    BEGIN
    APEX_APPLICATION.G_FLOW_ID :=245;
    IF NOT (wwv_flow_custom_auth_std.is_session_valid) then
    owa_util.status_line(404, 'Page Not Found',true);
    return;
    else
    SELECT MIME_TYPE, BLOB_CONTENT, name,DBMS_LOB.GETLENGTH(blob_content)
    INTO v_mime,lob_loc,v_file_name,v_length
    FROM spp_attachments
    WHERE id = p_file;
    -- set up HTTP header
    -- use an NVL around the mime type and
    -- if it is a null set it to application/octect
    -- application/octect may launch a download window from windows
    owa_util.mime_header( nvl(v_mime,'application/octet'),
    FALSE );
    -- set the size so the browser knows how much to download
    htp.p('Content-length: ' || v_length);
    -- the filename will be used by the browser if the users does a save as
    htp.p('Content-Disposition: attachment;
    filename="'||replace(REPLACE(substr(v_file_name,instr(v_file_name,'/')+1),chr(10),NULL),chr(13),NULL)|| '"');
    -- close the headers
    owa_util.http_header_close;
    -- download the BLOB
    wpg_docload.download_file( Lob_loc );
    end if;
    end download_file; }
    Thank you,
    Mark

  • .indd File Mime type

    Could anybody tell me what the mime type for .indd files are?
    Am trying to allow indesign files into our DMS but I need the mimetype, can only find it associted with "application/octet-stream" but this mimetype allows things like .exe files etc
    Is there is specific mime type for indesign files and other adobe products file extensions like for pdf = "application/pdf"
    Thanks.

    Indeed, hastingsr is correct.
    There is no official MIME type for InDesign -- it does not appear in the IANA's listing: http://www.iana.org/assignments/media-types/application/index.html.
    But if you consult the XMP metadata that InDesign writes, it identifies itself in the Dublin Core metadata as application/x-indesign:
    <dc:format>application/x-indesign</dc:format>
    application/x- types are not covered in a registry, and are basically a free-for-all, but the IETF has realized that's not the best move, and that state is changing. See http://tools.ietf.org/id/draft-ietf-appsawg-xdash (Deprecating Use of the "X-" Prefix in Application Protocols. P. Saint-Andre, D. Crocker, and M. Nottingham. October 24, 2011).
    More than you wanted to know? :)

  • How to fix the "MIME types" problem  !

    Hello !
    How to fix the problem of "MIME types", Windows doesn't want to keep the APPS by default !!!
    When I try the application by default (for ex. right clic on .PSD files and "open with"), then I validates the selection program (Photoshop.exe), it does not appear in the selection of programs by default in windows!
    Result, even dynamic objects no longer open in my applications and all adobe files icon don't appear in explorer
    Thx

    I find a solution who works for me (Win7 64bit) !
    Use a Registry cleaner (ccleaner) and kill old file format entry !
    Now restart association with a .AI file, because the way to .exe is in another place like other apps !
    Try this:
    First, right click on your illustrator apps icon (desktop or Start menu) and choose "open the file location" and copy the dir ("C:\Program Files\Adobe\Adobe Illustrator CC 2014\Support Files\Contents\Windows" for me )
    Right clic on your .AI file and select "Open with", now click on "browse" to "C:\Program Files\Adobe\Adobe Illustrator CC 2014\Support Files\Contents\Windows" for 64bit system.
    "Windows" say "you've got problem with registry file association" the correction's automaticatly and the illustrator icon appear in the list of default apps.
    Select and valid him
    Now, do the same for all your "unknown files type" with the good apps !

  • Print HTML using JPS API.. How to configure printer MIME-TYPE as text/html

    Hi All,
    I have to print the HTML pages.. for this i have used JPS API , but i found that my printer doesnt supoort Mime-type(Flavour) text/html.
    Can someone help me in this ...
    i) Can i configure my printer for this Mime-type , if yes then HOW?
    ii) Is there any work around ?
    Thank you all in advance :)

    I reposted this question in the Database forum. Admin can feel free to delete this thread.
    The answer is to add this at the top: htp.addDefaultHTMLHdr(false);
    Thanks,
    T.
    Edited by: 855677 on May 3, 2011 9:35 AM

  • How to get the mime type of the workflow attachment attached to workitem id

    Hi Experts,
    I can attach different types of attachment to the workitem id, lets suppost the attachment type attached is pdf, for this attachment I have an requirement to send the mime type as well. In this case the mime type is 'application/pdf' for pdf files.(for text file it is 'text/plain' and for zip file it is 'application/zip' and so on)
    Do I have any place in ABAP world where I can get the mime type for different types of attachments.
    I dont want to hard code the mime types, and I have checked the transaction 'SMW0', but not sure if this is the correct place to get the mime type.
    Do you see any other way or tables which stores all these mime types.
    Any help/suggestion would be appreciated.
    Thanks and Regards,
    Neerup.

    Hello,
    Perhaps this can help:
    http://help.sap.com/saphelp_nw04/helpdata/en/ad/ebe5cc1d75aa43a2871717d76f475d/content.htm
    If you want to know the table name, turn on tracing (ST05) when accessing the MIME types.
    regards
    Rick Bakker
    Hanabi Technology

  • How to get file encoding type

    Hi ,
    How to get the file encoding type,
    for example file is saved with the .txt and encoding is utf-8 and another file is saved .txt with encoding is ascii,
    actually before reading the file i want idetify the encoding type
    please help me it is very urgent for me..
    thanks in advance

    As there is no established regime for signing most encoding types, the only way to do this is to start parsing the file in one encoding, see if you get something that makes sense, and if not try another encoding, and so on. I.e. you have to code it yourself and even then it is not usually reliable. Sorry.
    Drake

  • How to set "Files of type" when using a "File Browse" item.

    Apex 4.0.2
    Internet Explorer 7 +
    I have a "File Browse" item on a page and need to limit the types of files display to just "text (.txt)" files. How can this be done? Currently, the "Files of type" list shows "All File (*.*)", "Pictures (*.gif,*.png)", and HTML (*.htm,*.html)". In the best case, I would like to not have the "Files of type" list and have the user just limited to text files. However, adding Text files (*.txt)" to the "Files of type" list is ok.
    thanks,
    William

    Thought i'd do a bit of research after seeing Scotts wonderful ideas.
    So it turns out, IE made the file item read only from version 8, for security reasons. Read more: http://blogs.msdn.com/b/ie/archive/2008/07/02/ie8-security-part-v-comprehensive-protection.aspx
    File Upload Control
    Historically, the HTML File Upload Control (<input type=file>) has been the source of a significant number of information disclosure vulnerabilities. To resolve these issues, two changes were made to the behavior of the control.
    To block attacks that rely on “stealing” keystrokes to surreptitiously trick the user into typing a local file path into the control, the File Path edit box is now read-only. The user must explicitly select a file for upload using the File Browse dialog.
    Additionally, the “Include local directory path when uploading files” URLAction has been set to "Disable" for the Internet Zone. This change prevents leakage of potentially sensitive local file-system information to the Internet. For instance, rather than submitting the full path C:\users\ericlaw\documents\secret\image.png, Internet Explorer 8 will now submit only the filename image.png.To resetting the actual items, suggestions I found were to replace the actual item. So instead of using $s, I just replace the element, with the existing element, causing it to re-initialise.
    var htmldb_delete_message='"DELETE_CONFIRM_MSG"';
    function fileCheck(el){
        if(el.value){
            var validFile = false;
            var validExtensions = ["csv"];
            var filename = el.value;
            var fileExtIndex = filename.lastIndexOf(".");
            var fileExt = filename.substring(fileExtIndex+1, filename.length);
            for(i = 0; i < validExtensions.length; i++){
                if(validExtensions[i] == fileExt){
                    validFile = true;
                    break;
            if ( !validFile || fileExtIndex == -1) {
                alert("Invalid Extension. Permitted files must end with: " + validExtensions.toString());
                var htmlContents = el.outerHTML || new XMLSerializer().serializeToString(el);
                $('#P16_BINARY').replaceWith(htmlContents);
    }(obviously, replacing what you need to, to suit your page - i prefer scotts idea of passing in supported file types in the function, so would just pass in an array instead; but this is just for demonstration)
    with an onchange="checkFile(this)" on the element attributes.
    On a slightly un-related note, I found out IE doesn't support the wonderful indexOf function on arrays, that checks for the existence of the value in an array. Sucks.
    Edited by: trent
    Ah well, jQuery is there, maybe i should use that for searching arrays in the future.
    http://api.jquery.com/jQuery.inArray/
    Edited by: trent
    Forgot a demo link, for csv files: http://apex.oracle.com/pls/apex/f?p=45448:16
    Edited by: trent
    Modify function. Didn't work in Firefox

Maybe you are looking for

  • Itunes wont run because it says i am missing file: MSVCR80.dll help?

    so ive recently deleted and reinstalled my iTunes due to an error with the program. both before the delete and after the reinstall it would not open and an error message would pop up on the screen saying that file MSVCR80.dll was missing from my comp

  • The problem when using iframe

    I am trying to include a JSF page inside the iframe tag. But I have some problem here. The page that contains the iframe is like this: <html> <head> <title>IFRAME</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head

  • Planning Function to update Fiscal Period Characteristics

    Hi, Is it possible to write a Planning Function that would update empty Fiscal Period Characteristics from the already populated 0CALMONTH Characteristic?  I know the ABAP required if I can use it, but I'm just wondering about IP having the ability t

  • How to increase the size of box in the screen

    Hi All, I am using a box in the screen. I want to extend the size of the box but i m getting a message that the maximum length is limited to 132.... Can you please tell me how to extend the size of the box in the screen. Any pointers in this case wou

  • Cancel the material document creation process

    Hello Experts I am having the requirement where i have to check for some custom validations before posting the material document. If those validation fail, material document should not be created. i tried that by finding suitable user-exit or BADI fo