Sample code for doing a “chunked” webfile HTTP d ownload, and then stream to HTTP upload to anot

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

On Tue, Dec 8, 2009 at 11:22 AM, Greg H. <
[email protected]> 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.