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 6774735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:49:24+00:00 2026-05-26T15:49:24+00:00

i want to develope and application in node.js where i shud b able to

  • 0

i want to develope and application in node.js where i shud b able to upload a video in my page and store a link to that video in database(mongodb).when i click //to the link the vedio should get displayed.also i shud b able to display all the //video’s uploaded in the page.I tried to code to upload phot

//new show photo code  
app.get('/photos', function(req, res) {
    photos.list(function(err, photo_list) {
    res.render('photos/index', {locals : {
    photos: photo_list
    }});
  });
});

app.get('/photos/new', function(req, res){
  res.render('photos/new', {
             locals: {
               title: 'New File Upload'
             }
  });
});

app.post('/photos', function(req, res) {
  req.setEncoding('binary');
  var parser = multipart.parser();
  parser.headers = req.headers;
  var ws;
  parser.onpartBegin = function(part) {
    consol.log('inside begin');
    ws = fs.createWriteStream(__dirname + '/static/upload/photos.' + part.filename)
    ws.on('error', function(err) {
      throw err;
    });
  };
  parser.onData = function(data) {
    ws.write(data);
  };
  parser.onPartEnd = function() {
    ws.end();
    parser.close();
    console.log('file successfully uploaded');
    res.redirect('/photos');
  };
  req.on('data', function(data) { 
      console.log('shud not go here');
      parser.write(data);
  });
}); 

//can any one send me the code for the same or else find were i am doing //wrong…..answer immediately required….

  • 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-26T15:49:24+00:00Added an answer on May 26, 2026 at 3:49 pm

    You should use formidable for file uploads in Node.js, it’s a widely used library for such a thing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to develop application that my database is not in the localhost, like
I want to develop an application that disables the Background Data (new feature in
I want to develop an application to connect to a PostgreSQL Database, I want
I want to develop an application that does a bunch of cool stuff. The
i want to develop an application that take email and password of facebook as
I want to develop mysql database application using dbexpress to develop from scratch or
I want to develop an application for the iPhone that generates custom DTMF tones.
I want to develop an application for the iPhone that creates a custom memory
I want to develope my first real WPF Desktop Application. It's quite a lot
I want to develop application that sends image/txt or any file from one android

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.