Download button
zuphilip opened this issue · 6 comments
(Splitted from #60)
Current Behaviour
After uploading a local file and transform it, the download button does nothing.
After choosing an url of a file and transform it, the download button will simply provide a link to that url, which is the input file.
Goal
The goal should be to download the output file. I guess that the button is currently more like a placeholder and the logic behind it is still missing.
Code
I only have found this code for the button:
ocr-fileformat/web/ocr-fileformat.js
Lines 86 to 96 in 5ec0dd4
Pull request #70 partially implemented the desired functionality. The following use case still does not work for me:
- Go to https://digi.bib.uni-mannheim.de/ocr-fileformat/
- Enter URL https://digi.bib.uni-mannheim.de/~stweil/ocr-praxis/0001-tesseract.hocr
- Transform from
hocr
toalto2.0
- Press 'Download' button
Expected behavior: download of result (ALTO XML)
Observed behavior: download of input (hOCR)
Yes, that is the else case in
ocr-fileformat/web/ocr-fileformat.js
Lines 103 to 105 in b85360e
Yup, and change the basename replacement. I'll send a PR.
Also needs to make use of Blob/createObjectURL/revokeObjectURL since src attribute will become too large quickly.
We do now. Before that, a two years old version was running.