DICOM files missing after uploading with Firefox in Orthanc Explorer

Issue #21 resolved
Sébastien Jodogne
repo owner created an issue

What steps will reproduce the problem?

Open Mozilla Firefox. Upload the files from a study with several dozens of DICOM instances, with the "Upload" tab of Orthanc Explorer. I used the TOUTATIX sample from OsiriX (that contains 2028 files for about 200MB).

What is the expected output? What do you see instead?

The transfer is tagged as successful, but the statistics of the Orthanc core report only 155 instances:

$ curl http://localhost:8042/patients/b2160db0-765812e8-d65568b3-3748b5c0-0b86bea2/statistics
{
   "CountInstances" : 155,
   "CountSeries" : 1,
   "CountStudies" : 1,
   "DiskSize" : "17527506",
   "DiskSizeMB" : 16,
   "UncompressedSize" : "17527506",
   "UncompressedSizeMB" : 16
}

What version of the product are you using? On what operating system?

  • Orthanc 1.1.0 under Linux
  • Mozilla Firefox 47.0

This problem does not seem to affect Chromium and Google Chrome.

Temporary solution

  • Use Chromium or Google Chrome, or
  • Use the ImportDicomFiles.py sample script.

Comments (15)

  1. Benjamin Golinvaux

    I am seeing this with Chrome (Version 71.0.3578.98 (Official Build) (64-bit)) with Orthanc 1.3.0 running on Synology DS918+

    Is that only supposed to occur with Chrom(e|ium) ?

    A few directions to debug the issue maybe? :)

    orthanc_21.PNG

  2. Alain Mazy

    When you say "seeing this"; do you mean you see the popup or you observed that some files are missing after the upload.
    Actually, the popup shows whatever your browser.

    So right now, next step would be to implement a browser detection in the explorer js code to show the popup only to firefox users (That's probably as fast as writing this phrase).
    Second step would be to re-write the file upload mechanisms in the explorer js code too. I think that last time Seb tried that he entered a JS dependency hell and gave up.

  3. Sébastien Jodogne reporter

    This issue normally only arises only on Firefox, but this assumption has not been thoroughly tested, so the popup warning is displayed on any browser (including Chrome/Chromium even if it should not be affected).

    Solving this issue would require a refactoring of Orthanc Explorer (update of the "jquery-file-upload" library, that would in turn need an update of jQuery Mobile, which would eventually lead to very deep modifications because backward compatibility is not ensured in the framework). As an alternative solution, we could separate the upload page from the main jQuery Mobile application, enabling us to use a different framework.

    Check also the remarks about "Orthanc Explorer 2": http://book.orthanc-server.com/faq/improving-interface.html

  4. Benjamin Golinvaux

    For some reason, I thought there was a browser detection mechanism and that it was bogus. Probably because I underestimated the consequences of implementing a browser detection mechanism, as explained by Seb.

    So, there is no other issue than the dialog box showing up under Chrome. Sorry for the trouble!

    And thanks for the technical explanation. Having a look at the code before actually creating issues would be a sensible move on my end 👅

  5. Alain Mazy

    Just created a branch and updated jquery & co: https://bitbucket.org/sjodogne/orthanc/commits/5713952f60c0b6e57d31f8bbc5d5a33d07204fb1

    My problem right now is that on my Ubuntu machine, drag and drop from Nautilus to Firefox hardly ever work (files are not listed). This is, I think, totally independent from Orthanc because I observe it with other sites too -> installing a new VM for that.

    On windows, with Firefox, I could not reproduce the problem with 1.5.1 so I can not tell if this upgrade helped. -> to be continued.

  6. Alain Mazy

    Actually, I've upgraded jQuery core to 1.9.1 because that was the one known to be compatible with jQuery Mobile 1.4.5.
    For the file upload, I've upgraded to the released a bit after jQuery Core 1.9.1.

    Indeed, we can try upgrading the file upload to a yet newer release but first, I need to be able to reproduce the issue.

  7. Alain Mazy

    Just created an independent upload page in plain HTML/JS: https://bitbucket.org/sjodogne/orthanc/commits/e4f146b7d2d9903354f5c1feda6059e9c60ba168

    If using the "browse" button, all files are always uploaded even when selecting 150 of them.
    If using drag and drop, with a few files, it usually works but, as soon as you try to drop 150files, it takes firefox around 10 seconds to trigger the "dragover" and "drop" events and not all files that are dropped are listed in the events.

    This has been tested on Ubuntu 18.10 with Firefox 64.0. I can not reproduce it on Windows.

    To me, the problem lies in the interaction between the Ubuntu file manager and Firefox.
    On Ubuntu, I've tried uploading the same files to WeTransfer and Firefox is equally unresponsive when I drop 150 files.
    So it looks like the only sure way to upload files via Firefox on Ubuntu is using the "browse" button (unfortunately, it's also incredibly slow and sometimes need 10 seconds to open the file browser dialog).

    So it looks like upgrading jQuery ... was not necessary at all since the plain HTML/JS fails the same way. I would recommend that:
    - we forbid drag-drop for Firefox
    - we add a "browse" button for all browsers
    - instead of showing the issue #21 popup, on Firefox, we display a jQuery warning to tell users that drag-drop is not available

    to be discussed ...

  8. Sébastien Jodogne reporter

    Maybe linked to this issue? https://askubuntu.com/a/981426

    On Ubuntu 14.04 with Firefox 60.0.1, using your new "upload.html" page, uploading 1000 DICOM files with the "Browse..." button is fast and perfectly usable.

    In either case, I am not in favor of blocking drag-and-drop depending on the browser, as this issue is visibly independent of Orthanc, and could be fixed in future releases of Ubuntu and Firefox. Furthermore, maybe this issue is very specific to Ubuntu/Nautilus: KDE-based distributions might be unaffected. Finally, Firefox on Windows is apparently not affected, so disabling drag-and-drop on any Firefox is definitely not desirable.

    If this popup warning is too intrusive, I would simply recommend to add a textual warning at the top of the upload form, possibly only displayed if the browser is Firefox.

  9. Log in to comment