Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Internet
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Colaboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #6  
Antiguo 17-11-2009
Alzheimer Alzheimer is offline
Miembro
 
Registrado: mar 2009
Posts: 16
Poder: 0
Alzheimer Va por buen camino
hola ....
aki te posteo una posible solucion utilizando los IdTCP de las Indy

del lado servidor:
pon un TIdTCPServer en una form y hazle un command handler k se llame upload por ejemplo y ponle al recibir el komando el siguiente kodigo:

Código:
procedure TForm1.IdTCPServer1UploadCommand(ASender: TIdCommand);
var
  archivo : TFileStream;
  fout: string;
begin
try
 fout:= 'd:\'+ASender.Params[0];
 archivo := TFileStream.Create(fout,fmCreate or fmOpenWrite);
 ASender.Thread.Connection.ReadStream(archivo);
finally
 archivo.Free;
end;
end;
del lado cliente:
inserta un TIdTCPClient.
kuando kieras enviar el archivo ejemplo usando un button:

Código:
procedure TForm1.Button1Click(Sender: TObject);
 var
  archivo: TFileStream;
  AFile: string;
begin
AFile:= 'D:\Administrador\$h@\FantasticTool.exe';
 if  FileExists(AFile) then begin
   archivo:= TFileStream.Create(AFile,fmOpenRead);
    try
      IdTCPClient1.Connect();
      if IdTCPClient1.Connected then begin
       IdTCPClient1.WriteLn('Upload '+ExtractFileName(AFile));
       IdTCPClient1.WriteStream(archivo,true,true);
      end;
    finally
     archivo.Free;
     IdTCPClient1.Disconnect;
    end;
  end else begin

  end;
end;

espero te sirva de ayuda... es menos k implementar un FTP kompleto. aunke si estas interesado en algo komo esto te rekomiendo utilizar el de las ICS. (en mi opinion esta mucho mas trabajado y kompleto ***ademas de muy sencillo*** k el de las INDY)

salu2
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 03:57:47.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi