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

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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.4.6, 2.5
    • 2.4.7, 2.5.3
    • Files API
    • MOODLE_24_STABLE, MOODLE_25_STABLE
    • MOODLE_24_STABLE, MOODLE_25_STABLE
    • m26_MDL-40226_Add_JNLP_MIME_Type_Support
    • 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.

    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

      Attachments

        Issue Links

          Activity

            People

              matteo Matteo Scaramuccia
              hanna123 hanna edelman
              Frédéric Massart Frédéric Massart
              Dan Poltawski Dan Poltawski
              Andrew Lyons Andrew Lyons
              Matteo Scaramuccia, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                11/Nov/13