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

Set payload filename on upload even if primaryKey exists. #19771

Merged
merged 6 commits into from
Sep 25, 2023

Conversation

0x2aff
Copy link
Contributor

@0x2aff 0x2aff commented Sep 22, 2023

Should fix #19657

The multipart handler on file upload only sets the payload filename if we upload new file.
If we always add the filename to the payload we always update the file extension on disk and download-filename.

This way on image replace we update the file extension on disk and download filename.
@changeset-bot
Copy link

changeset-bot bot commented Sep 22, 2023

🦋 Changeset detected

Latest commit: 693ac0a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@directus/api Patch
directus Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@DanielBiegler DanielBiegler requested review from a team, paescuj, br41nslug and DanielBiegler and removed request for a team September 22, 2023 21:14
Copy link
Contributor

@DanielBiegler DanielBiegler left a comment

Choose a reason for hiding this comment

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

Works for me! Both the extension in (Disk) and filename in (Download) change now.

@br41nslug br41nslug merged commit 158019f into directus:main Sep 25, 2023
7 checks passed
@github-actions github-actions bot added this to the Next Release milestone Sep 25, 2023
@0x2aff 0x2aff deleted the fix/19657_AssetExtensionNotUpdated branch September 25, 2023 10:25
br-rafaelbarros pushed a commit to personal-forks/directus-source that referenced this pull request Nov 7, 2023
…9771)

* Set payload filename on upload even if primaryKey exists.

This way on image replace we update the file extension on disk and download filename.

* Add 0x2aff to contributors.yml

* Put 0x2aff contributor into quotes.

* add changeset

* Update changeset to reflect also extension

---------

Co-authored-by: Daniel Biegler <DanielBiegler@users.noreply.github.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replacing an image asset the extension is not updated.
3 participants