Sample code for doing a “chunked†webfile HTTP d ownload, andthen stream to HTTP upload to anothe

Discussion in 'Ruby' started by Greg Hauptmann, Dec 8, 2009.

  1. Hi,

    QUESTION: Does anyone have sample code that shows how to do an (a)
    chunked HTTP file download, and then (b) stream this into the HTTP
    uploading of this to another web application with a file upload
    controller?

    BACKGROUND
    * I've been trying to "stream" an existing webpage to a separate web
    application, using normal http request response approach.
    * The issue I'm hitting is that there are some times when preparing
    the upload, whereby the source webserver where I'm sourcing the file
    from does NOT set the **content-length**, hence I can't set this for
    the upload.
    * My thinking is that to get around this the approach might be to use
    HTTP chunked mode (however I haven't had any experience with this).
    I'm trying to avoid (a) having to download the file to disk first, but
    also (b) store the whole file up in memory before uploading
    * The upload has to be a POST

    thanks
    Greg Hauptmann, Dec 8, 2009
    #1
    1. Advertising

  2. Greg Hauptmann

    Tony Arcieri Guest

    Re: Sample code for doing a “chunked†webfile HT TP download,and then stream to HTTP upload to another web a pp?

    [Note: parts of this message were removed to make it a legal post.]

    On Tue, Dec 8, 2009 at 11:22 AM, Greg Hauptmann <
    > wrote:

    > Hi,
    >
    > QUESTION: Does anyone have sample code that shows how to do an (a)
    > chunked HTTP file download, and then (b) stream this into the HTTP
    > uploading of this to another web application with a file upload
    > controller?
    >


    This shouldn't be too difficult to do with either Rev or EventMachine, which
    both provide evented HTTP clients and servers.

    --
    Tony Arcieri
    Medioh! A Kudelski Brand
    Tony Arcieri, Dec 8, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?VHJleSBNaXRjaGVsbA==?=

    ASP.Net querying Active Directory works on one page and not anothe

    =?Utf-8?B?VHJleSBNaXRjaGVsbA==?=, Jul 19, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    381
    =?Utf-8?B?VHJleSBNaXRjaGVsbA==?=
    Jul 19, 2005
  2. =?Utf-8?B?SHVzYW0=?=

    Connect to anothe database

    =?Utf-8?B?SHVzYW0=?=, May 30, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    279
    Jon Paal [MSMD]
    May 30, 2007
  3. Replies:
    4
    Views:
    340
    eric dexter
    Jun 28, 2010
  4. Husam

    Connect to anothe database

    Husam, May 30, 2007, in forum: ASP .Net Security
    Replies:
    1
    Views:
    109
    Alexey Smirnov
    May 30, 2007
  5. George Moschovitis
    Replies:
    5
    Views:
    154
    guest
    Jan 19, 2006
Loading...

Share This Page