haystack / nb

12 stars 10 forks source link

PDF download should have a proper name with .pdf extension #274

Closed JumanaFM closed 8 months ago

JumanaFM commented 1 year ago

Currently, when downloading a pdf file, the name is the ID of the document in the DB with no extension. While it's functional and users can always rename the document, it's a better experience if the document had a more meaningful name (name on UI) with .pdf extension. Try to download a pdf on NB for more info.

JumanaFM commented 8 months ago

suggestion from Arvind:

const DEFAULT_URL = "uploads/" + urlParams.get('id’)

should be:

const DEFAULT_URL = "uploads/" + urlParams.get('id’) + ".pdf”;

or alternatively for better readability:

const DEFAULT_URL = uploads/${urlParams.get('id’)}.pdf;