miniflare icon indicating copy to clipboard operation
miniflare copied to clipboard

preserve file path in FormData objects

Open yusefnapora opened this issue 2 years ago • 0 comments

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 :)

yusefnapora avatar Jul 12 '22 19:07 yusefnapora