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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:39:01+00:00 2026-06-14T09:39:01+00:00

I want provide a rest service api by restify ( or express ) the

  • 0

I want provide a rest service api by restify ( or express )

  • the duty of service is let client who could put audio/mpeg or other
    binary file to our server, and then verify the authentication, if
    pass, put the file to amazon s3, and then check the s3 client
    response statusCode, if s3 client reponse statusCode == 200 , do
    somethings

solution1: using request stream pipe to put files to
amazon by knox

var stream = s3.put(filepath, {options});
serverReq.pipe(stream);
stream.on('response', function(err, s3Res) {
    if (err) { console.log(err); }
    if (s3Res.statusCode == 200) { store file infos on DB}
}

solution2: using formdiable and fs to pre store file on server local temp folder and then put files to amazon by knox

(after pre store file on server local temp folder)
s3.putFile(sourcePath, destPath, {options}, function(err, _res) {
    (clear local files from local temp folder)

    if (err) { return next(err); }
    if (_res.statusCode == 200) {console.log('save on %s', s3.url(dest))}
    res.send(_res.statusCode);
    return next();
});

which way is better between solution 1 and solution 2 or other better way ??
and does here has any performance issues need to know?

  • 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-14T09:39:03+00:00Added an answer on June 14, 2026 at 9:39 am

    Depending on the server load and your available bandwidth, your diskio is your biggest potential bottleneck. I would say go with solution 1 that streams the file directly and doesn’t store it to physical media. Make sure you don’t attempt to store the entire object to memory either or you could run into a system resources problem.

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

Sidebar

Related Questions

I want to provide a REST API for my Django application which will run
I want to provide a button which cancels the present task, Let's say I
We are building a rest service and we want to use OAauth 2 for
Let's say I have some service that talks over ZeroMQ sockets, and I want
I'm using the Jersey Client library to run tests against a rest service running
I'm designing a REST-style API for a service that provides analysis of clinical data.
I'm using python-dbus and cherrypy to monitor USB devices and provide a REST service
I want to use WCF REST service methods in my HTML5 form. I guess
I understand why REST framework vendors want to provide the support for returning both
I am writing a REST API for a service that will accept user contributed

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.