Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-40226

JNLP files show up in the user's browser as XML files

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4.6, 2.5
    • Fix Version/s: 2.4.7, 2.5.3
    • Component/s: Files API
    • Labels:
    • Testing Instructions:
      Hide

      (Difficulty: easy)

      Test fixture

      1. Download a JNLP file, e.g. from here: http://docs.oracle.com/javase/tutorial/deployment/webstart/examples/webstart_ComponentArch_DynamicTreeDemo/src/dynamictree_webstart.jnlp
      2. Upload the JNLP file as a File resource somewhere, even in the frontpage
      3. "Download" the file from Moodle checking that the Content-Type Header is wrong e.g. if the JNLP file will be deployed in the frontpage you can use both the Browser Dev Tools (F12) or an HTTP HEAD call via curl:

        # curl -I http://hostname/path/to/moodle/pluginfile.php/106/mod_resource/content/1/dynamictree_webstart.jnlp
        ...
        Content-Disposition: inline; filename="dynamictree_webstart.jnlp"
        ...
        Content-Type: text/html; charset=UTF-8
        ...
        

      Test case #1 (Fixing the already uploaded files)

      1. Check that the same File resource now returns the correct MIME Type:

        # curl -I http://hostname/path/to/moodle/pluginfile.php/106/mod_resource/content/1/dynamictree_webstart.jnlp
        ...
        Content-Disposition: inline; filename="dynamictree_webstart.jnlp"
        ...
        Content-Type: application/x-java-jnlp-file
        ...
        

      Test case #2 (Checking new uploaded files)

      1. Upload again a JNLP file as a File resource somewhere, even in the frontpage. The file could be the same or something new found again around the network
      2. Check that the File resource returns the correct MIME Type:

        # curl -I http://hostname/path/to/moodle/pluginfile.php/<resid, must be different from the previous one being a new resource>/mod_resource/content/1/<filename>.jnlp
        ...
        Content-Disposition: inline; filename="<filename>.jnlp"
        ...
        Content-Type: application/x-java-jnlp-file
        ...
        

      Note: if you have Java correctly configured in your PC, a Java sample application will start few seconds after you'll click on that resource, out of your browser.

      Show
      (Difficulty: easy) Test fixture Download a JNLP file, e.g. from here : http://docs.oracle.com/javase/tutorial/deployment/webstart/examples/webstart_ComponentArch_DynamicTreeDemo/src/dynamictree_webstart.jnlp Upload the JNLP file as a File resource somewhere, even in the frontpage "Download" the file from Moodle checking that the Content-Type Header is wrong e.g. if the JNLP file will be deployed in the frontpage you can use both the Browser Dev Tools ( F12 ) or an HTTP HEAD call via curl : # curl -I http://hostname/path/to/moodle/pluginfile.php/106/mod_resource/content/1/dynamictree_webstart.jnlp ... Content-Disposition: inline; filename="dynamictree_webstart.jnlp" ... Content-Type: text/html; charset=UTF-8 ... Test case #1 (Fixing the already uploaded files) Check that the same File resource now returns the correct MIME Type: # curl -I http://hostname/path/to/moodle/pluginfile.php/106/mod_resource/content/1/dynamictree_webstart.jnlp ... Content-Disposition: inline; filename="dynamictree_webstart.jnlp" ... Content-Type: application/x-java-jnlp-file ... Test case #2 (Checking new uploaded files) Upload again a JNLP file as a File resource somewhere, even in the frontpage. The file could be the same or something new found again around the network Check that the File resource returns the correct MIME Type: # curl -I http://hostname/path/to/moodle/pluginfile.php/<resid, must be different from the previous one being a new resource>/mod_resource/content/1/<filename>.jnlp ... Content-Disposition: inline; filename="<filename>.jnlp" ... Content-Type: application/x-java-jnlp-file ... Note: if you have Java correctly configured in your PC, a Java sample application will start few seconds after you'll click on that resource, out of your browser.
    • Affected Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      m26_MDL-40226_Add_JNLP_MIME_Type_Support

      Description

      mimetype .jnlp is not implemented (supported) in Moodle.
      (We are using it to open GeoGebra Java editor)

      Clicking on a .jnlp link, inside any page show the XML content of the file instead of starting a Java Web Start dialog that can run the JNLP application.

      Checking the mdl_files table, I can see that the .jnlp files that are uploaded into Moodle get an application/xml mimetype. where it should be application/x-java-jnlp-file

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    11/Nov/13