Coder Social home page Coder Social logo

file-upload-multer's Introduction

File Uploads to Server with Multer

To upload a file you need to:

  1. adjust the form on the front-end. Take a look at upload-pictures.hbs. โœ…
  2. On the back-end you need to set up a route that processes the data coming from the form. Since form that contain files send their data in a different encoding type (multi-part/formdata), you need a package that can parse data in this datatype. This package is multer. Check the npm page for multer. Make sure your field-names match.:white_check_mark:
  3. Save a reference to the file in the database. This example uses a simple Picture model, but you can include a path in any kind of model. โœ…

General tip: use Postman ๐Ÿ“ฆ to first implement the route. If you got that to work, you can start focussing on the front-end. This will not only speed up your workflow considerably, but it will also become easier to create automated tests later as well!

file-upload-multer's People

Contributors

jtonneyck avatar

Forkers

sunnydoubleu

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.