Improving names of exported archives
Because there is no limit to the length of documents' names, and because some of our users named their documents with a lot of details, we are sometimes facing cases where the exported file creates a Windows bug where the name of the file is too long to be able to be manipulated once it's downloaded. Besides, it is very helpful to rely of document's ids, since we can easily reconstruct the url based on this id, which is not the case with the document's name (not unique nor permanent). So, I see 2 ways to impove the naming of the archive files exported from escriptorium:
- in
export_%s_%s_%s.txt" % (slugify(document.name).replace('-', '_'),file_format, datetime.now().strftime('%Y%m%d%H%M'))
; set a max length todocument.name
- add the document's id in the name such as :
export_%s_%s_%s_%s.txt" % (document.pk, slugify(document.name).replace('-', '_'),file_format, datetime.now().strftime('%Y%m%d%H%M'))
As a side comment, Transkribus enables the user to set the pattern of the exported filename. I have never used it so I consider it's probably too much effort to build an equivalent option. But I mention it still, juste in case. It looks like this: