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

preserve file path in FormData objects #309

Merged
merged 2 commits into from
Aug 17, 2022
Merged

preserve file path in FormData objects #309

merged 2 commits into from
Aug 17, 2022

Conversation

yusefnapora
Copy link
Contributor

Hi, I'm working on a project that pulls File objects out of multipart FormData uploads and needs the full file path in order to correctly calculate some hashes and so on.

In a real CF worker, File objects from multipart uploads include the full path in their name property, e.g. directory/foo.txt, but Miniflare just sets the basename (foo.txt).

This PR just sets preservePath: true when constructing a Busboy instance, to make the behavior line up with the real worker env.

Let me know if there's any changes you'd want, or if you'd like me to file an issue to track the bug.

Cheers :)

Copy link
Contributor

@mrbbot mrbbot left a comment

Choose a reason for hiding this comment

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

Hey! 👋 Thanks for the PR! Looks great! ✅ Apologies for the delayed response. I've recently returned from a long holiday.

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