Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3484486
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:47:37+00:00 2026-05-18T10:47:37+00:00

How do you extract form data ( form[method=post] ) and file uploads sent from

  • 0

How do you extract form data (form[method="post"]) and file uploads sent from the HTTP POST method in Node.js?

I’ve read the documentation, googled and found nothing.

function (request, response) {
    //request.post????
}

Is there a library or a hack?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T10:47:38+00:00Added an answer on May 18, 2026 at 10:47 am

    If you use Express (high-performance, high-class web development for Node.js), you can do this:

    HTML:

    <form method="post" action="/">
        <input type="text" name="user[name]">
        <input type="text" name="user[email]">
        <input type="submit" value="Submit">
    </form>
    

    API client:

    fetch('/', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json'
        },
        body: JSON.stringify({
            user: {
                name: "John",
                email: "john@example.com"
            }
        })
    });
    

    Node.js: (since Express v4.16.0)

    // Parse URL-encoded bodies (as sent by HTML forms)
    app.use(express.urlencoded());
    
    // Parse JSON bodies (as sent by API clients)
    app.use(express.json());
    
    // Access the parse results as request.body
    app.post('/', function(request, response){
        console.log(request.body.user.name);
        console.log(request.body.user.email);
    });
    

    Node.js: (for Express <4.16.0)

    const bodyParser = require("body-parser");
    
    /** bodyParser.urlencoded(options)
     * Parses the text as URL encoded data (which is how browsers tend to send form data from regular forms set to POST)
     * and exposes the resulting object (containing the keys and values) on req.body
     */
    app.use(bodyParser.urlencoded({
        extended: true
    }));
    
    /**bodyParser.json(options)
     * Parses the text as JSON and exposes the resulting object on req.body.
     */
    app.use(bodyParser.json());
    
    app.post("/", function (req, res) {
        console.log(req.body.user.name)
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the following code: <form action= method=post enctype=multipart/form-data> <label for=file>Filename:</label> <input type=file name=file
I'm using jQuery.ajax to extract form data from a page, and send it to
I need to extract multiple text/dropdown list fields from an asp.net form and format
I'm using ExtJS to make a form that generates a report from the data
I am trying to extract some data from a website using a LINQ statement,
Given a filename in the form someletters_12345_moreleters.ext , I want to extract the 5
I extract the audio from a bunch of flv files as an MP3. This
I would like to extract the date a jpg file was created. Java has
I need to extract and decode barcodes and text from images. Is there any
How do you extract an RT_RCDATA section from a Win32 executable (preferably in C#)?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.