Skip to content

Phune23/Demo-Upload-Files

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demo-Upload-Files

How to Upload Files in Node.js Using Express and Multer.

⬇ Install Express and Multer:

npm install express multer

⚙ Run:

nodemon App.js

🖼 Picture Demo:

Exam about upload localfile

Exam Upload local file

When send file by postman, the file is upload in folder Uploads

Exam Upload local file

🏷 If you run have error like this:

nodemon : The term 'nodemon' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling 
of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ nodemon app.js
+ ~~~~~~~
    + CategoryInfo          : ObjectNotFound: (nodemon:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

🏷 You can try this way:

npm i -g nodemon

🏷 After you trying the above method, you still get an error like this:

nodemon : File C:\Users\ADMIN\AppData\Roaming\npm\nodemon.ps1 cannot be loaded. The file C:\Users\ADMIN\AppData\Roaming\npm\nodemon.ps1 
is not digitally signed. You cannot run this script on the current system. For more information about running scripts and setting        
execution policy, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=********.
At line:1 char:1
+ nodemon app.js
+ ~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

🏷 You can try this way:

You can open your Terminal and Run administrator this code.

Set-ExecutionPolicy Unrestricted

📍 Link website Multer-npm : Multer-npm

About

How to Upload Files in Node.js Using Express and Multer

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Contributors