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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:42:26+00:00 2026-06-13T09:42:26+00:00

I wrote a website tracker for internal use, since Google Analytic don’t meet the

  • 0

I wrote a website tracker for internal use, since Google Analytic don’t meet the requirement.

I use node.js with Express to develop that tracking system. Everything works well so far. But I want to confirm is, if there is some problem behind if I insert a log data after response a image.

Thanks!

function image_response(req, res, next){
    var buf = new Buffer([0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x01, 0x00, 0x01, 0x00, 0x80, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x02, 0x02, 0x44, 0x01, 0x00, 0x3b]);
    res.send(200, buf);
    next();
}

app.get('/tracker.gif', image_response, function(req, res){
     // blah blah blah 
     // DB insert codes..
}

Actually the “image_response” is completely end of the response and close the browser connection with client. Afterward, doing the logic to save the data to DB.

  • 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-06-13T09:42:27+00:00Added an answer on June 13, 2026 at 9:42 am

    You cant modify the result if you did res.send(), use res.write() + res.end() instead.

    res.send() is a convenience method of express which unites res.write() and res.end() for easy use. If you want to send data in the response in multiple places you have to use the nodejs’ methods write and end on the result.

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

Sidebar

Related Questions

The file upload script I wrote early last year for an internal website has
I wrote an autocompletion script for an input field on a website. It uses
I wrote this script to for a contact form on my website, everything works
So I've wrote a small script to download pictures from a website. It goes
I made an website with php and I wrote .htacess file in my htdocs
I'm using Django Paginator everywhere on my website and even wrote a special template
I created a asp.net website. and added a class file to it. i wrote
I wrote a website in HTML but then I wanted the header and navbar
I wrote a login panel for my website and everything looks fine but when
I wrote a js widget for listing one's github repos on any website with

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.