This discussion is archived
9 Replies Latest reply: Apr 20, 2013 2:51 PM by TexasApexDeveloper RSS

Apex does not support .docx?

goj1 Newbie
Currently Being Moderated
Hello, I'm from Brazil and I need help.

Working with Apex and i'm one problem.
I do manitenção in an application whose version of apex 4.1.1.
In this application there is a page that has link to download files like docx, pdf and more.

The link does not work with docx files. When you click the link the following error occurs:

HTTP Status 500 - System Unavailable. Please try again later.

--------------------------------------------------------------------------------

type Status report

messageSystem Unavailable. Please try again later.

descriptionThe server encountered an internal error (System Unavailable. Please try again later.) that prevented it from fulfilling this request.


--------------------------------------------------------------------------------

GlassFish Server Open Source Edition 3.1.1


with other files anything goes wrong, it is only the docx.
Has anyone experienced this or know how to solve to give a hint?

I need help

Very grateful for the attention.

Hugo
  • 1. Re: Apex does not support .docx?
    jrimblas Expert
    Currently Being Moderated
    Hugo, are these documents blobs in the database?
    Are you using built in functionality to handle files/blobs? Or do you have your own code?
    If the docs are stored in a file, do you have a MIME type field? What's the MIME type for the DOCX files?

    Thanks
    -Jorge
  • 2. Re: Apex does not support .docx?
    goj1 Newbie
    Currently Being Moderated
    Jorge, I'm using a Blob field and is its MIME TYPE: application / vnd.openxmlformats-officedocument.wordprocessingml.document

    To better exmplicar. In the application I created a template page Print Friendly.
    When I click the download link, the file is opened or downloaded in PDF format but the report fields appear blank in PDF.

    Thanks
    Hugo
  • 3. Re: Apex does not support .docx?
    jrimblas Expert
    Currently Being Moderated
    Whoa, that's one crazy long MIME Type.
    Just for kicks and to rule out where the problem is can you change it on the table to "application/msword" (with no quotes of course).

    Could you have a data type size problem somewhere? Meaning the field too small to hold the mime type value?

    Thanks
    -Jorge
  • 4. Re: Apex does not support .docx?
    goj1 Newbie
    Currently Being Moderated
    I had manually changed the MIME Type to msword and it worked, but I need this to be done dynamically every time a new record is made an update should be done.
    I'll try to do it in the process.
    A trigger or PL / SQL with an if .... then ... else.
    I'll test it today and post the result.

    a hug
    Thank you for your attention.

    Hugo.
  • 5. Re: Apex does not support .docx?
    jrimblas Expert
    Currently Being Moderated
    Hugo,
    Before you go through that trouble, if you control the glassfish server you may be able to change the mime type mapping there.
    You see it's the webserver's job to determine the mine type not APEX. But in the past, I've had to override the mime types when the webserver cannot be configured.

    Good luck.
    -Jorge

    I would appreciate it if you flag my answer as useful or correct. :)
  • 6. Re: Apex does not support .docx?
    goj1 Newbie
    Currently Being Moderated
    Hello Jorge,

    I will create a process to verify that the apex MIME TYPE is docx, if so, change to doc.

    That was the quickest solution, because where I work there is a sepação sectors and industry that cares pain is another server. Will take longer to change glassfish.

    From what I've realized what is happening is: there is no setting in GlassFish to the MIME type TYPE DOCX, so when the error occurs it cites GlashFish the URL.
    I went to the team that takes care of the server and they asked me where should change this in GlassFish. I do not know, I'm now studying the GF.
    Do you know where does this in GlassFish?

    Thank you again for your attention. :)

    Thank you,
    Hugo
  • 7. Re: Apex does not support .docx?
    jrimblas Expert
    Currently Being Moderated
    goj1 wrote:
    Do you know where does this in GlassFish?
    Sorry, I do not.

    I see your problem. It happens.
  • 8. Re: Apex does not support .docx?
    goj1 Newbie
    Currently Being Moderated
    I await your return
    And I will study the GlassFish to see if I can find out.

    Thanks,
    Hugo
  • 9. Re: Apex does not support .docx?
    TexasApexDeveloper Guru
    Currently Being Moderated
    See this link: http://davidwburns.wordpress.com/2008/02/07/how-to-add-a-new-mime-type-to-glassfish/

    Pass this along to your server support folks..

    Thank you,

    Tony Miller
    LuvMuffin Software
    Ruckersville, VA

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points