Having looked at this article: http://lollyrock.com/articles/express4-file-upload/
I realized that Multer used to upload files when you did not know what name is being loaded in the form field. For example, if you look at the โUsing Multerโ section of the article, youโll see that when calling app.use() author does not use .single() , .array() or .fields() . If you do this with the current version of Multer, you will receive a TypeError: app.use() requires middleware functions error TypeError: app.use() requires middleware functions .
While I have a little idea on how to use .single() , .array() or .fields() , my current project requires me to send a non-standard number of files to the server (maybe a series of .png or .log ). Therefore, I do not know what field names will be in advance.
This was easy using the version of Multer used in the article (0.1.6), but it seems impossible when trying to use it in the current version of Multer (1.0.3), since you need to specify the names of the form fields.
As an alternative, finding a complete guide for an online cartoon was a difficult task, since the best of them seems to be the Readme from the GitHub repo, and this seems to be missing. Perhaps the answers I'm looking for will be somewhere in the guidebook.
Thanks!
source share