The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Downloading a File With VW HTTP

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
Downloading a File With VW HTTP Posted: Mar 26, 2008 8:41 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: Downloading a File With VW HTTP
Feed Title: Cincom Smalltalk Blog - Smalltalk with Rants
Feed URL: http://www.cincomsmalltalk.com/rssBlog/rssBlogView.xml
Feed Description: James Robertson comments on Cincom Smalltalk, the Smalltalk development community, and IT trends and issues in general.
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Cincom Smalltalk Blog - Smalltalk with Rants

Advertisement

I've had support in BottomFeeder for downloading files via HTTP for quite some time, but it's always involved some hacking. In VW 7.6, it still requires some coding, but - with a hat tip to Martin Kobetic - a lot less hacking. First, you'll want to download this small parcel, which contains one class - DownloadBuildHandler (A subclass of HttpBuildHandler).

Once you have that, all you need is something like this:


'http://www.cincomsmalltalk.com/audio/2008/industry_misinterpretations80.mp3' asURI
	envelopeReadStreamDo: [ :stream || target |
		target := 'industry_misinterpretations80.mp3' asFilename writeStream binary.
		[	DownloadBuildHandler readFrom: stream to: target.
		] ensure: [ target close ] ].

Obviously, you might want some more prettiness, like a progress bar, or, at the very least, a "wait while..." dialog. However, that's polish - the basic technique is above, and it's pretty easy.

Technorati Tags: ,

Read: Downloading a File With VW HTTP

Topic: Is Software Practice Advancing - the video Previous Topic   Next Topic Topic: Industry Misinterpretations 80: Is Software Practice Advancing?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use