Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom filename for content-disposition #1010

Merged
merged 10 commits into from
Mar 28, 2024
Merged

Custom filename for content-disposition #1010

merged 10 commits into from
Mar 28, 2024

Conversation

jrchudy
Copy link
Member

@jrchudy jrchudy commented Mar 25, 2024

This PR adds support for an new annotation property on the asset annotation, stored_filename_pattern. This property will allow for data modelers to customize the content-disposition value that is stored in hatrac for the file and the value stored in the filename_column (if defined on the annotation). This pattern uses the same template variables as url_pattern with a new one added called filename_stem, the name of the file without the extension.

More details in the comment on issue 1949 in chaise.

@jrchudy jrchudy requested a review from RFSH March 25, 2024 20:21
@jrchudy jrchudy self-assigned this Mar 25, 2024
Copy link
Member

@RFSH RFSH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should also update line 449 and 452 (where you recently changed so we would update the filename of already uploaded files) to use .storedFilename instead of .file.name.

Apart from that everything looks good to me and test cases passed locally.

@jrchudy jrchudy requested a review from RFSH March 27, 2024 23:38
js/hatrac.js Outdated Show resolved Hide resolved
js/hatrac.js Outdated Show resolved Hide resolved
@jrchudy jrchudy merged commit 2063d94 into master Mar 28, 2024
1 check passed
@jrchudy jrchudy deleted the custom-filename branch March 28, 2024 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants