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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:02:55+00:00 2026-06-05T06:02:55+00:00

I have this code: http.createServer(function (req, res) { if (req.method.toLowerCase() === post) { res.writeHead(200);

  • 0

I have this code:

http.createServer(function (req, res) {
  if (req.method.toLowerCase() === "post") {
    res.writeHead(200);
    req.on('data', function (data) {
      console.log(data.toString());
    });
    res.end();
  }
}).listen(8006);

and if I try to upload a file with a curl command like curl http://localhost:8006/upload -X POST -F file=@filetoupload.txt, I’ll get the name of the file and the contents of the file printed out, which in this case are the following:

------------------------------5d02ba973600
Content-Disposition: form-data; name="file"; filename="filetoupload.txt"
Content-Type: text/plain


<!-- start slipsum code -->

Do you see any Teletubbies in here? Do you see a slender
plastic tag clipped to my shirt with my name printed on
it? Do you see a little Asian child with a blank expression
on his face sitting outside on a mechanical helicopter that
shakes when you put quarters in it? No? Well, that's what
you see at a toy store. And you must think you're in a
toy store, because you're here shopping for an infant
named Jeb.

<!-- end slipsum code -->


------------------------------5d02ba973600--

Now the question is, are there any good ways to catch the values of the filename, and the contents of the file ? Or will I have to get in some kind of regular expressions voodoo to extract the values of the content above ?

I’d like to do this without any third party module like express, first because I would like to learn how this works and second because express’ bodyParser() saves all the files to disk and then other modules like formidable have to read from disk, and I’m trying to make something that pipes the file upload directly to Rackspace CloudFiles without having to save to disk first.

  • 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-05T06:02:59+00:00Added an answer on June 5, 2026 at 6:02 am

    Read through the code in Formidable (which Connect, and therefore Express, uses for handling file uploads) and use it as a starting point, modifying behaviors you don’t like (such as saving to disk).

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

Sidebar

Related Questions

I have this code: $.getJSON('http://www.reapp.se/cmesapp/cmes.json?callback=?', function(data){ alert(disco); }).error(function() {alert(fail!;}); Which is sending out an
Given code like this from a node.js neophyte like me: require('http').createServer(function( req, resp )
I have this code: function submitTwice(f){ f.action = 'http://mydomain.com/threevideopage.php'; f.target='name'; f.submit(); } I left
I have this code : http://jsfiddle.net/VAkLn/6/ When i add a table : http://jsfiddle.net/VAkLn/7/ this
I have this code: http://pastebin.com/Sd9WKZFr When i call something like rate(60, -6000, 120000) it
Hey I have this code right here: http://pastie.org/534470 And on line 109 I get
I have this code require 'mechanize' @agent = Mechanize.new page = @agent.get('http://something.com/?page=1') next_page =
I have this php code $filename = verbs.php; // http://alylores.x10.mx/vega/verbs2.php $handle = fopen($filename, r);
Suppose we have this example: http://techdroid.kbeanie.com/2009/07/custom-listview-for-android.html with source code available here: http://code.google.com/p/myandroidwidgets/source/browse/trunk/Phonebook/src/com/abeanie/ How can
I have found this project on Codeplex. http://www.codeplex.com/ProjNET I need to integrate this code

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.