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

  • SEARCH
  • Home
  • 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 7044195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:22:51+00:00 2026-05-28T02:22:51+00:00

Here’s the flow that I am trying to achieve: 1) User uploads an audio

  • 0

Here’s the flow that I am trying to achieve:

1) User uploads an audio file to server1
2) Server1 receives that audio file and sends it to server2 in different domain
3) Server2 converts audio file to text
4) Server2 responds back to server1 with text
5) Server1 displays the text to the user

Speech to text conversion on server2 is done. I am stuck on sending the audio file and waiting for response. I know how to send request using GET, but I don’t think I can use it with audio files.

How can I send an audio file to another server using node.js?

I am pretty new to node.js, so any help would be appreciated. Thanks.

UPDATE:
Server2 uses REST API and expects the file to be POST’ed.

  • 1 1 Answer
  • 1 View
  • 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-28T02:22:51+00:00Added an answer on May 28, 2026 at 2:22 am

    It totally depends on how the remote server expects to receive the audio file. Assuming that it has some sort of RESTful web service interface whereby the file contents are POST’ed to some URL, you might be able to do something like this:

    fs.readFile('/path/to/my/audiofile.wav', function (err, data) {
      if (err) throw err;
      var options = {
        host: 'remotehost.com',
        path: '/upload/wav',
        method: 'POST',
        headers: { 'Content-Type': 'audio/wav' }
      };
      var req = http.request(options, function(res) {
        // Handle a successful response here...
      });
      req.on('error', function(e) {
        // Handle an error response here...
      });
      // Write the audio data in the request body.
      req.write(data);
      req.end();
    });
    

    Again, it completely depends on how the server wants you to send the data. It may expect a completely different protocol (or method, or path), authentication, encoding, or any number of specifics which would completely change the viability of my sample answer.

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

Sidebar

Related Questions

Here's what I'm trying to accomplish with this program: a recursive method that checks
Here is what I am trying to achieve in PHP: I have this string:
Here's the deal: I'm in the process of planning a mid-sized business application that
Here is the css: #content ul { font-size: 12px; } I am trying this:
Here is what is supposed to happen: The moment the user chooses an option
Here's a query that works fine: SELECT rowid as msg_rowid, a, b, c FROM
Here is my code (Say we have a single button on the page that
Here's what I'm trying to do... It's quite simple and obviously there must be
Here is another spoj problem that asks how to find the number of distinct
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

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.