File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -211,6 +211,12 @@ declare namespace multer {
211211 } | undefined ;
212212 /** Preserve the full path of the original filename rather than the basename. (Default: false) */
213213 preservePath ?: boolean | undefined ;
214+ /**
215+ * For multipart forms, the default character set to use for values of
216+ * part header parameters (e.g. filename) that are not extended
217+ * parameters (that contain an explicit charset). (Default: latin1)
218+ */
219+ defParamCharset ?: string | undefined ;
214220 /**
215221 * Optional function to control which files are uploaded. This is called
216222 * for every file that is processed.
Original file line number Diff line number Diff line change @@ -15,6 +15,19 @@ const upload = multer({
1515upload ; // $ExpectType Multer
1616assert . strictEqual ( upload . constructor . name , "Multer" ) ;
1717
18+ const upload_with_defParamCharset = multer ( {
19+ dest : "uploads/" ,
20+ fileFilter : ( req , file , cb ) => {
21+ cb ( null , false ) ;
22+ cb ( null , true ) ;
23+ cb ( new Error ( `I don't have a clue!` ) ) ;
24+ } ,
25+ defParamCharset : "utf8" ,
26+ } ) ;
27+
28+ upload_with_defParamCharset ; // $ExpectType Multer
29+ assert . strictEqual ( upload_with_defParamCharset . constructor . name , "Multer" ) ;
30+
1831const app = express ( ) ;
1932
2033app . post (
Original file line number Diff line number Diff line change 11{
22 "private" : true ,
33 "name" : " @types/multer" ,
4- "version" : " 2.0 .9999" ,
4+ "version" : " 2.1 .9999" ,
55 "projects" : [
66 " https://github.com/expressjs/multer"
77 ],
You can’t perform that action at this time.
0 commit comments