6

I notice both Orion Version 0.99.126.4.1-beta (WebKit 618.1.2) and Orion RC Version 0.99.126.4.1.1-rc (WebKit 618.1.7) as well as previous versions cannot handle filename declared in Content-Disposition header when downloading news from NZBHydra.

To replicate I created a Flask server to serve file download:

from flask import Flask, make_response

app = Flask(__name__)

@app.route('/getnzb/user/8131442528953639797')
def custom_header():
    content = 'Your response content here'
    response = make_response(content)
    response.headers['Content-Type'] = 'application/x-nzb;charset=UTF-8'
    response.headers['Content-Disposition'] = 'attachment; filename="testtesttesttesttest.nzb"'
    response.headers['Cache-Control'] = 'no-cache, no-store, max-age=0, must-revalidate'
    response.headers['Content-Length'] = str(len(content))
    return response

if __name__ == '__main__':
    app.run(debug=True)

Both Orion & Orion RC handle the filename wrongly.

While Safari handles the filename correctly

It should work with Safari 17.2+: https://caniuse.com/?search=content-disposition

Orion RC Version 0.99.126.4.1.1-rc (WebKit 618.1.7)

Ventura (13)

  • dino replied to this.
    anhdeptrai changed the title to Onion downloads to wrong filename which is declared by Content-Disposition header .

      IIRC this issue occours in iOS version as well.

        a month later

        anhdeptrai not able to reproduce this by setting-up the suggested environment. can you please provide a test URL, where we can test this? with suitable steps to reproduce

          20 days later

          dino I don't see this issue on desktop, but on mobile Orion at least for blob URLs the filename is not respected. Visiting this example page https://stuk.github.io/jszip/ and clicking the 'Run' button prompts to download 'example.zip' on desktop, but a UUID (with no .zip extension) on mobile.

          • dino replied to this.

            adamaveray that means it's mobile only issue? as I was trying to reproduce this on Desktop only and not able to reproduce this even by your gshared URL.

            Please remove Desktop flag to make this issue to Mobile only (to avoid further confusion)
            So we will add this to Mobile priority list ๐Ÿ™‚

              dino Oh itโ€™s not my issue originally, I was about to submit the mobile report but found this one that seems to cover the same issue so commented here instead. The original submitter will have to make that tags change I guess.

              @anhdeptrai looks like this issue is Mobile only, as it's not reproducible on Orion Desktop, so can you please remove Desktop flag to make this issue to Mobile only (to avoid further confusion)

                14 days later

                dino No I still reproduce the issue on lastest Orion RC. Version 0.99.127.1-rc (WebKit 619.1.1)
                Build date Mar 26 2024.

                To reproduce run the python script and access http://127.0.0.1:5000/getnzb/user/8131442528953639797 from Orion vs Safari. Safari downloads the file with expected filename.

                • dino replied to this.

                  anhdeptrai when I am trying to access http://127.0.0.1:5000/getnzb/user/8131442528953639797 using same setup and code you providec, I am getting correct filename. So can you please share a prototype code (zipped), so I will try to reproduce that. A recorded video will also be helpful to understant, what exact steps you are using to reproduce this issue.

                    dino Thanks I think I found the culprit. Only if I enable uMatrix (installed from Chrome/FF store), it messes up the filename.

                      9 days later
                      13 days later

                      Create a hyperlink that downloads a blob:

                      <a
                      href={URL.createObjectURL(new Blob([JSON.stringify("{}", parseDateIntoLocalStorage) || ""], { type: "application/json" }))}
                      download={"test.json"}
                      >
                      test
                      </a>

                      2-Click on it
                      3-The file name will be a random hash name instead of test.json

                      I expect the browser to use the name inside the "download" property

                      1.3.7 (15)

                      17

                        Merged 3 posts from Downloaded files are having file name removed.

                          This should be fixed in upcoming iOS as well, will let @dino confirm

                          No one is typing