Sven Van Caekenberghe wrote
Now, you are right that there should be some convenience method to make that easier. I'll think about it for a bit and let you know if I can come up with something.
What about: download: urlString to: anFSReference "anFSReference can be either: - a directory, where the file will be saved under its original name - otherwise, the file will be saved as the FSReference" | target entity | target := anFSReference isDirectory ifTrue: [ anFSReference / urlString asUrl path last ] ifFalse: [ anFSReference ]. entity := ZnClient new streaming: true; get: urlString; entity. target fileStreamDo: [ :stream | stream binary. entity writeOn: stream ]. This would allow really easy, flexible use like: "Save in this directory as same name" ZnClient download: 'http://www.pharo-project.org/images/pharo.png' to: '/Volumes/Fast/Squeak/Main Working Images/Pharo-1.3' asFile. "Save under new name in this exact place" ZnClient download: 'http://www.pharo-project.org/images/pharo.png' to: '/Volumes/Fast/Squeak/Main Working Images/Pharo-1.3/new_name.png' asFile. -- View this message in context: http://forum.world.st/Downloading-a-file-tp4586900p4588519.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com.