closup / process-xbrl

3 stars 1 forks source link

download from session_id folder to user's downloads #58

Closed lucakato closed 1 month ago

lucakato commented 1 month ago

Goal: Be able to download output.html (now stored under a specific session folder) once conversion is complete.

This line defines the download:

image

The download="converted_xbrl.html" means that when you download the file, it will be called converted_xbrl.html, but the first attribute (href) actually provides the document to be downloaded. Right now, it's set to static/output/output.html, but we'll want to change that to the session-specific file (saved in static/sessions_data/<session-id>/output/output.html).

You can definitely do this with javascript if you prefer, but it might be easier to do it with jinja2 formatting. If you go with the jinja2 route, you'll want to pass the session id to the render_template() function here:

image

and then adjust the href in the download anchor in upload.html

lucakato commented 1 month ago

@kwheelan Could you check out branch #58-downloads-session-id (I made this branch based on branch #52) and see if it works for you? I'm getting the following error I'm wondering if it's the merge conflicts you resolved. Tested it on just Clayton.xlsx

image image
kwheelan commented 1 month ago

@lucakato Looks like a merge issue. I'll take a look.

kwheelan commented 1 month ago

@lucakato I'm traveling today, but I'll fix the merge issues by the evening.

lucakato commented 1 month ago

@kwheelan no worries, I'll also have a look. thanks

kwheelan commented 1 month ago

@lucakato All the merge issues should be fixed. I've merged this into the dev branch (#61). Is this issue ready to close or do you need to add changes to the file save locations on this branch?

lucakato commented 1 month ago

@kwheelan I just never got to test the downloads. Is it working for you because I still encounter an error.

image
kwheelan commented 1 month ago

@lucakato Hmm it is working for me, but what document are you uploading? Try this one, and let me know if you still get errors. Clayton Excel.xlsx

lucakato commented 1 month ago

@kwheelan Oh yes, your Excel file does work. I was using Clayton.xlsx is this old?

kwheelan commented 1 month ago

@lucakato Aha yes that one is old. It must have an issue somewhere in the Excel sheet

lucakato commented 1 month ago

@kwheelan yup It works. Regarding the viewer, do you want viewer.html to be saved in site/? or under the session folder

image
kwheelan commented 1 month ago

@lucakato It should be saved under the user's sessions folder. If that breaks anything major, lmk and we can try to troubleshoot.

lucakato commented 1 month ago

@kwheelan just made that change!