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

When you pass on a file (URL) using form-data it doesn't use the Content-Disposition filename #29

Closed
mkasson opened this issue Oct 12, 2017 · 2 comments
Labels
bug Something isn't working example-apps

Comments

@mkasson
Copy link

mkasson commented Oct 12, 2017

This issue submission follows a conversation with Fokke.

Your "creates/upload.js" shows use of Form-Data and request to upload a file presented to a create by a trigger. However, I have seen Form-Data is not receiving the filename from the Content-Disposition line. I have had to set filename manually (providing a placeholder) using the Alternate Submission Methods and submitted PR #7 relating to this.

Form-Data says that it "can recognize and fetch all the required information from common types of streams (fs.readStream, http.response and mikeal's request)". This suggests that the filename is not getting to request and/or Form-Data correctly. (Perhaps the issue is in stashing and/or dehydration - though I admit I am not super familiar with the impact of those.) Fokke and I have both observed Form-Data using the value from path in this method

Thank you for your attention to this.

@FokkeZB FokkeZB changed the title Uploading file to form-data should provide filename with Content-Disposition When you pass on a file (URL) using form-data it doesn't use the Content-Disposition filename Oct 23, 2017
@FokkeZB
Copy link
Contributor

FokkeZB commented Oct 23, 2017

This may be a bug in form-data which as https://www.npmjs.com/package/form-data#alternative-submission-methods says:

Form-Data can recognize and fetch all the required information from common types of streams (fs.readStream, http.response and mikeal's request), for some other types of streams you'd need to provide "file"-related information manually:

This example uses request but @mkasson found that when you follow the example the multipart body generated by form-data does not use the filename from the file URL, while we do send the filename as part of the Content-Disposition.

@xavdid xavdid transferred this issue from zapier/zapier-platform-example-app-files Jun 25, 2019
@xavdid xavdid added bug Something isn't working example-apps labels Jun 26, 2019
@rnegron
Copy link
Member

rnegron commented Mar 1, 2023

Given that it has been some time since this issue was created and it may be stale, I am going to go ahead and close it. Please feel free to open a new issue if necessary!

@rnegron rnegron closed this as completed Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working example-apps
Projects
None yet
Development

No branches or pull requests

4 participants