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

Lack of filename results in an error #2

Open
tmfksoft opened this issue May 25, 2017 · 6 comments
Open

Lack of filename results in an error #2

tmfksoft opened this issue May 25, 2017 · 6 comments

Comments

@tmfksoft
Copy link

Although in almost all use cases a filename is supplied, it is not a mandatory value.
It'd also be nice if the files "name" parameter is returned.

The error from a lacking filename arg:

/home/thomas/discord_bot/node_modules/parse-multipart/multipart.js:28
                        var k = str.split('=');
                                   ^

TypeError: Cannot read property 'split' of undefined
    at obj (/home/thomas/discord_bot/node_modules/parse-multipart/multipart.js:28:15)
    at process (/home/thomas/discord_bot/node_modules/parse-multipart/multipart.js:37:14)
    at Object.exports.Parse (/home/thomas/discord_bot/node_modules/parse-multipart/multipart.js:87:19)
    at fs.readFile (/home/thomas/discord_bot/scripts/best.js:28:25)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:445:3)

I hope this isn't too much trouble.

@tmfksoft
Copy link
Author

I have written such functionality in, pretty much entirely replacing your process function with my own. It caters for multiple files with the same "name" as well as supporting the lack of Content-Disposition.

Although Content-Disposition is REQUIRED by spec, Amazon AWS returns multipart/related which lacks it.
This means my edited code will work without it and merely sets "name" to null.

I can PR this code if you'd like it. However I cannot promise it being bug free. However works fine both with DemoData and Amazon AWS v1 response.

@christiansalazar
Copy link
Contributor

christiansalazar commented May 25, 2017 via email

@christiansalazar
Copy link
Contributor

christiansalazar commented May 25, 2017 via email

@tsherdiwala
Copy link

@tmfksoft
I had been facing the same issue. Thanks for raising the same.

@christiansalazar
Any plans on when to accept the PR?

@christiansalazar
Copy link
Contributor

@tmfksoft Hi, because time compromised in my side (2 dev jobs :) ) then it has taken a little bit more time for to give you a nice time for yout PR. Now, because i have 2 pending issues in this repo then i will work on it tomorrow

@christiansalazar
Copy link
Contributor

@tmfksoft Hi there, your PR is not forgotten...:) it is only i have no opportunity to test is further in order to be incorporated to serve the very basic feature AND your extension. Will do in the first oportunity..

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

No branches or pull requests

3 participants