title: How to chain write stream, immediately with a read stream in Node.js 0.10?
body: <p>The following line will download an image file from a specified <code>url</code> variable:</p>
  
  <pre><code>var filename = path.join(__dirname, url.replace(/^.*[\\\/]/, ''));
  request(url).pipe(fs.createWriteStream(filename));
  </code></pre>
  
  <p>And these lines will take that image and save to MongoDB GridFS:</p>
  
  <pre><code> var gfs = Grid(mongoose.connection.db, mongoose.mongo);
   var writestream = gfs.createWriteStream({ filename: filename });
   fs.createReadStream(filename).pipe(writestream);
  </code></pre>
  
  <p>Chaining <code>pipe</code> like this throws <strong><em>Error: 500 Cannot Pipe. Not Pipeable.</em></strong></p>
  
  <pre><code>request(url).pipe(fs.createWriteStream(filename)).pipe(writestream);
  </code></pre>
  
  <p>This happens because the image file is not ready to be read yet, right? What should I do to get around this problem?Error: 500 Cannot Pipe. Not Pipeable.</p>
  
  <p>Using the following: <strong>Node.js 0.10.10</strong>, <strong>mongoose</strong>, <strong>request</strong> and <strong>gridfs-stream</strong> libraries.</p>