Hi people,

I already try the code and modified to fit my requirements.

It work very well thanks to visualAd, but i have a little problem with the control winsockt, i duno how to ensure the control propely connect or disconect.

It works great, but at some point the control dosent disconect or conecct and the code hang up, into an infinite cilce, in part 1 or part 2 (listed in the code above)

i already try a lot of things, and of course i have 2 event's that change the flags for conected or disconected, on sckts events.

i hope somebody can help to figure out this issue.

Sorry for my very bad english.

this is part of the code:

lngIndice = 1
While lngIndice <= lngCantidadArchivos

' if the conection is un use, wait until disconected
' (part 1 when the control don't disconnect propely)
If Not mbolSckConectado Then

' Here i set variables for teh file
strNombreArchivo = arsNumerosOV(lngIndice) & ".PDF"
strArchivoPDF = strDirectorio & strNombreArchivo

' here i get the contents of file
strContenidoArchivo=dfObtenerContenidoArchivo(strArchivoPDF)

' here i biuld the HTTP request
strRequisicionHTTP = dfHTTPRequest(strContenidoArchivo, udtURLDestino, strNombreArchivo, strNombreArchivo, strTipoMIME)

' here i conecct to the server, and wait until conected
' (part 2 when the control don't connect propely)
sckSitioWeb.Connect
While Not mbolSckConectado
DoEvents
Wend

' here i send the HTTP request
sckSitioWeb.SendData strRequisicionHTTP

' here i susspend the program ejecution 2 sec
dfSuspenderEjecucion 2

End If

Wend