Error : Bad Request - when uploading filename with unescaped chars #717

jfroffice opened this Issue Dec 25, 2012 · 5 comments


None yet
4 participants

Strange thing, when I upload file called PaulC%E9zanne.jpg,

I get this callstack :

at SendStream.error (/app/node_modules/express/node_modules/send/lib/send.js:145:16)
at SendStream.pipe (/app/node_modules/express/node_modules/send/lib/send.js:298:31)
at Object.static (/app/node_modules/express/node_modules/connect/lib/middleware/static.js:83:8)
at next (/app/node_modules/express/node_modules/connect/lib/proto.js:190:15)
at Object.cookieSession [as handle] (/app/node_modules/express/node_modules/connect/lib/middleware/cookieSession.js:113:5)
at next (/app/node_modules/express/node_modules/connect/lib/proto.js:190:15)
at Object.cookieParser [as handle] (/app/node_modules/express/node_modules/connect/lib/middleware/cookieParser.js:60:5)
at next (/app/node_modules/express/node_modules/connect/lib/proto.js:190:15)
at Object.methodOverride [as handle] (/app/node_modules/express/node_modules/connect/lib/middleware/methodOverride.js:37:5)
at next (/app/node_modules/express/node_modules/connect/lib/proto.js:190:15)

I've been seeing this too.

dougwilson was assigned Oct 24, 2013


dougwilson commented Nov 18, 2013

This stack trace is from serving a file, not uploading a file. What is the name of the file on the file system? If it is PaulC%E9zanne.jpg then your HTTP request must be for PaulC%25E9zanne.jpg (note the original % is encoded).

dougwilson closed this Nov 18, 2013


rlidwka commented Nov 20, 2013

He obviously wanted to upload a file named "PaulCézanne.jpg" to the server. I'm not sure what server should do in this case, maybe rename it or something.

Thank you for your reply,

Actually I use Express Js with Formidable api for upload

I remarked that file name with any caracter %XX cause a crash on server side.

Maybe it has been fixed since 11 months.

I can not reproduce the problem now.


dougwilson commented Nov 20, 2013

In that time, connect also stopped using formidable and started using multiparty which also could have been what fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment