[Squeak-fr] Problème pour télécharger une image.

Gaetan Le Brun gaetan.lebrun at gmail.com
Mer 20 Sep 13:24:34 UTC 2006


Bonjour,

Je cherche une manière de télécharger un fichier à partir d'une URL.

J'ai testé les 2 solutions ci-dessous :
fs := FileStream newFileNamed: 'mobile_icon3.gif'.
fs nextPutAll: ('http://localhost/resources/mobile_icon3.gif' asUrl
retrieveContents) content.
fs close.
(aString asUrl  retrieveContents) retourne un MIMEDocument.

fs := FileStream newFileNamed: 'mobile_icon3.gif'.
fs nextPutAll: (HTTPClient httpGet: '
http://localhost/resources/mobile_icon3.gif').
fs close
HTTPClient>>httpGet: anUrl  retourne un RWBinaryOrTextStream.


J'arrive bien à créer un fichier mais quand je l'ouvre via Preview ou Gimp
son type n'est pas reconnu.

Merci d'avance

-- 
------------------------------------------------------------
Gaëtan Le Brun
4 avenue Pierre Donzelot
35000 Rennes
------------------------------------------------------------
Email : gaetan.lebrun at gmail.com
Cell : +33 685 226294
------------------------------------------------------------
-------------- section suivante --------------
Une pièce jointe HTML a été enlevée...
URL: http://lists.squeakfoundation.org/pipermail/squeak-fr/attachments/20060920/1cafb995/attachment.htm


More information about the Squeak-fr mailing list