Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Guardar imagen desde URL

21 views
Skip to first unread message

pbarba

unread,
Sep 3, 2013, 6:46:19 AM9/3/13
to
Jaime Lucci escribi� el 18/04/2008 23:52 :
> Hola! Te paso el c�digo. Lo hice con XMLHTTP
>
> <%
> Function BinaryToString(Binary)
> Dim I, S
> For I = 1 To LenB(Binary)
> S = S & Chr(AscB(MidB(Binary, I, 1)))
> Next
> BinaryToString = S
> End Function
>
> Dim xml, objFS, archivo, simagen
> Response.Buffer = True
>
> simagen = "http://www.dominio.com/imagen.jpg"
>
> Set xml = Server.CreateObject("Microsoft.XMLHTTP")
> xml.Open "GET", simagen, False
> xml.Send
>
> Set ObjFS = CreateObject("Scripting.FileSystemObject")
> Set archivo = ObjFS.CreateTextFile
> ("c:CarpetaServidorImagenesimagen.jpg", true)
> archivo.WriteLine BinaryToString(xml.responseBody)
> archivo.Close
>
> Set xml = Nothing
> Set archivo = Nothing
> Set ObjFS = Nothing
>
> %>
>
> Sencillo, no?
>
> Saludos.
>
> Jaime Lucci
>
> "The_law2k" wrote in message
> news:
> On 18 abr, 12:15, "Jaime Lucci" wrote:
>> Ya solucion� lo que quer�a. Gracias.
>>
>> "Jaime Lucci" wrote in message
>>
>> news:
>>
>> > Hola a todos! Como andan?
>>
>> > Puego guardar en un directorio de mi servidor una imgen a partir de una
>> > URL??
>>
>> > Por ejemplo, quiero guardar la imagenhttp://www.dominio.com/imagen.jpgen
>> > c:CarpetaServidorImagenesimagen.asp.
>>
>> > Se puede? Lei algo sobre CURL pero es para PHP.
>>
>> > Gracias y saludos desde Salta, Argentina.
>>
>> > Jaime
>>
>>
>>
> Disculpame la pregunta, pero como fue que lo solucionaste?
>
Hola, un favor, explicame por que me da error en la linea
"archivo.WriteLine BinaryToString(xml.responseBody)" me dice que esta
mal la llamada al procedimiento.

Yo trato de bajar un codigo de barras que se crea en un url mandandole el
codigo
q quiero. Esta es la linea que le mando en la variable simagen:
(http://www.barcodesinc.com/generator/image.php?code=ASD3421&style=68&type=C128B&width=260&height=130&xres=2&font=4)

Lo he probado tambien con una imagen que si existe en el servidor pero igual no
la graba

Ayudame por favor

Gracias
0 new messages