Bonjour,<br><br>Je cherche une manière de télécharger un fichier à partir d'une URL.<br><br>J'ai testé les 2 solutions ci-dessous : <br><div style="margin-left: 40px;">fs := FileStream newFileNamed: 'mobile_icon3.gif'.<br>
</div><div style="margin-left: 40px;">fs nextPutAll: ('<a href="http://localhost/resources/mobile_icon3.gif">http://localhost/resources/mobile_icon3.gif</a>' asUrl&nbsp; retrieveContents) content.<br></div><div style="margin-left: 40px;">
fs close.<br></div>(aString asUrl&nbsp; retrieveContents) retourne un MIMEDocument.<br><br><div style="margin-left: 40px;">fs := FileStream newFileNamed: 'mobile_icon3.gif'.<br></div><div style="margin-left: 40px;">fs nextPutAll: (HTTPClient httpGet: '
<a href="http://localhost/resources/mobile_icon3.gif'">http://localhost/resources/mobile_icon3.gif'</a>).<br></div><div style="margin-left: 40px;">fs close<br></div>HTTPClient&gt;&gt;httpGet: anUrl&nbsp; retourne un RWBinaryOrTextStream.
<br><br><br>J'arrive bien à créer un fichier mais quand je l'ouvre via Preview ou Gimp son type n'est pas reconnu.<br><br>Merci d'avance<br><br>-- <br>------------------------------------------------------------<br>Gaëtan Le Brun
<br>4 avenue Pierre Donzelot<br>35000 Rennes<br>------------------------------------------------------------<br>Email : <a href="mailto:gaetan.lebrun@gmail.com">gaetan.lebrun@gmail.com</a><br>Cell : +33 685 226294<br>------------------------------------------------------------