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@gmail.com
Cell : +33 685 226294
------------------------------------------------------------