Ver Mensaje Individual
  #3 (permalink)  
Antiguo 24/08/2009, 10:52
Avatar de luisvasquez
luisvasquez
 
Fecha de Ingreso: diciembre-2003
Ubicación: Venezuela
Mensajes: 879
Antigüedad: 21 años, 4 meses
Puntos: 6
Respuesta: Guardar imágen con MSXML2.ServerXMLHTTP

Excelente Muzztein,

Esta es la función que hice a partir del código que está en la URL que me diste.

Código:
Function SalvaImagen(URL)

Const cOUT = "C:\imagenes\"
'*
'* Carga el archivo de imagen a partir del URL
'*

Dim objXML
'Set objXML = CreateObject("MSXML2.XMLHTTP")
Set objXML = CreateObject("Microsoft.XMLHTTP")
objXML.Open "GET", URL, False
objXML.Send
Dim binXML
binXML = objXML.ResponseBody
Set objXML = Nothing

'*
'* guarda el archivo
'*
Dim objADO
Set objADO = CreateObject("ADODB.Stream")
objADO.Type = 1
objADO.Open
objADO.Write binXML
objADO.SaveToFile cOUT & "test.png",2
Set objADO = Nothing

End function
muchas gracias!