Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Internet
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 04-10-2005
Avatar de AGAG4
AGAG4 AGAG4 is offline
Miembro
 
Registrado: ago 2004
Ubicación: Los Mochis, Sinaloa, México
Posts: 1.420
Poder: 21
AGAG4 Va por buen camino
Como Configurar WinXP como Servidor de FTP????

Alguien sabe como configurar una Pc con WinXP como Servidor de FTP????

Quiero Subir y bajar archivos de diferentes Pc's de otras REDES, he encontrado poco por la internet de configurar el XP como servidor.... espero alguien tenga algo de documentación al respecto...

Agradezco cualquier comentario.
Responder Con Cita
  #2  
Antiguo 04-10-2005
Avatar de roman
roman roman is offline
Moderador
 
Registrado: may 2003
Ubicación: Ciudad de México
Posts: 20.269
Poder: 10
roman Es un diamante en brutoroman Es un diamante en brutoroman Es un diamante en bruto
Desconozco si WinXP trae ya algún servidor FTP aunque lo dudo. Yo uso Cerberus que para uso personal es gratuito.

// Saludos
Responder Con Cita
  #3  
Antiguo 05-10-2005
Avatar de AGAG4
AGAG4 AGAG4 is offline
Miembro
 
Registrado: ago 2004
Ubicación: Los Mochis, Sinaloa, México
Posts: 1.420
Poder: 21
AGAG4 Va por buen camino
ok....

Lo que quiero es conectarme con un servidor de FTP, pero que no sea de algúna web agena, pero Gracias por su ayuda Roman.....

La duda que tengo también es que si se podría hacer un Servidor FTP con Windows 98 con algunos componentes en Delphi.

Que tenga buen día.
Responder Con Cita
  #4  
Antiguo 05-10-2005
Avatar de roman
roman roman is offline
Moderador
 
Registrado: may 2003
Ubicación: Ciudad de México
Posts: 20.269
Poder: 10
roman Es un diamante en brutoroman Es un diamante en brutoroman Es un diamante en bruto
Cita:
Empezado por AGAG4
La duda que tengo también es que si se podría hacer un Servidor FTP con Windows 98 con algunos componentes en Delphi.
De poderse se puede, por ejemplo con las componentes Indy. Pero no entiendo para qué quieres ponerte a programar uno. Cerberus no es un servidor en una Web ajena; es una aplicación FTP servidor, tal como la que quisieras construir tú mismo, que instalas en tu propia PC.

Yo lo tengo instalado en la pc de mi oficina y cotidianamente subo y bajo archivos desde mi casa con él.

// Saludos
Responder Con Cita
  #5  
Antiguo 05-10-2005
Avatar de AGAG4
AGAG4 AGAG4 is offline
Miembro
 
Registrado: ago 2004
Ubicación: Los Mochis, Sinaloa, México
Posts: 1.420
Poder: 21
AGAG4 Va por buen camino
ok..

Voy a probarlo de todas formas gracias Roman....
Responder Con Cita
  #6  
Antiguo 05-10-2005
Avatar de Sotrono
Sotrono Sotrono is offline
Miembro
 
Registrado: abr 2004
Ubicación: Buenos Aires - Argentina
Posts: 396
Poder: 20
Sotrono Va por buen camino
Como dice roman, conviene bajarte uno, pero por si te interesa, las Indy traen un ejemplo de servidor FTP.

Bytes...
Responder Con Cita
  #7  
Antiguo 05-10-2005
Avatar de mamcx
mamcx mamcx is offline
Moderador
 
Registrado: sep 2004
Ubicación: Medellín - Colombia
Posts: 3.911
Poder: 25
mamcx Tiene un aura espectacularmamcx Tiene un aura espectacularmamcx Tiene un aura espectacular
Win2000 en adelante tiene un servidor integrado, que se instala por Agregar/Quitar componentes de Windows.

Aunque de todas maneras, me parece mejor usar uno gratis. De entrada te recomiendo
http://www.apachefriends.org/en/xampp.html

Te instala Apache, PHP, Perl, MySql, FileZilla (servidor FTP) y otras cosas super facil y con un decente administrador centralizado por Web.

Me parece que es excelente y de paso matas varios pajaros de un tiro.
__________________
El malabarista.
Responder Con Cita
  #8  
Antiguo 05-10-2005
Avatar de AGAG4
AGAG4 AGAG4 is offline
Miembro
 
Registrado: ago 2004
Ubicación: Los Mochis, Sinaloa, México
Posts: 1.420
Poder: 21
AGAG4 Va por buen camino
ok

Gracias por sus comentarios los voy a tomar en cuenta y hacer pruebas....

Que tengan buen día.
Responder Con Cita
  #9  
Antiguo 07-10-2005
Avatar de AGAG4
AGAG4 AGAG4 is offline
Miembro
 
Registrado: ago 2004
Ubicación: Los Mochis, Sinaloa, México
Posts: 1.420
Poder: 21
AGAG4 Va por buen camino
Problemas al Bajar Archivos con Cerberus

Cita:
Empezado por roman
Desconozco si WinXP trae ya algún servidor FTP aunque lo dudo. Yo uso Cerberus que para uso personal es gratuito.

// Saludos
Roman, Instale el Servidor FTP Cerberus, todo funciona de maravilla, puedo Subir archivos, borrarlos, crear carpetas, desplazarme entre las carpetas pero no puedo BAJAR ARCHIVOS COMPLETOS, me baja el archivo pero con 0 bytes, ya lo intente bajandolos desde el internet explorer y desde un cliente Demo de los Indys y es la misma, ya revise el Cerberus y revise los derechos de la carpeta que tengo compartida para FTP y tiene todos los derechos de Subir, Bajar, Borrar, etc.... En donde puedo revisar dentro del programa Cerberus para poder bajar archivos????

Agradezco cualquier sugerencia.
Responder Con Cita
  #10  
Antiguo 07-10-2005
Avatar de Spynosa
Spynosa Spynosa is offline
Miembro
 
Registrado: nov 2004
Ubicación: Ecija - Sevilla
Posts: 99
Poder: 20
Spynosa Va por buen camino
Aqui tienes un servidor usando IdFTPServer de la indy a mi me funciona perfectamente
Código Delphi [-]
 unit Fftp;
 
 interface
 
 uses
   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
   IdBaseComponent, IdComponent, IdTCPServer, IdFTPServer,
   IdFTPList,
   IdSocketHandle,
   idglobal,
   IdHashCRC;
 
 type
   TFTP = class(TForm)
     IdFTPServer1: TIdFTPServer;
     procedure IdFTPServer1ChangeDirectory(ASender: TIdFTPServerThread;
       var VDirectory: String);
     procedure IdFTPServer1GetFileSize(ASender: TIdFTPServerThread;
       const AFilename: String; var VFileSize: Int64);
     procedure IdFTPServer1ListDirectory(ASender: TIdFTPServerThread;
       const APath: String; ADirectoryListing: TIdFTPListItems);
     procedure IdFTPServer1UserLogin(ASender: TIdFTPServerThread;
       const AUsername, APassword: String; var AAuthenticated: Boolean);
     procedure IdFTPServer1RenameFile(ASender: TIdFTPServerThread;
       const ARenameFromFile, ARenameToFile: String);
     procedure FormActivate(Sender: TObject);
     procedure IdFTPServer1CommandXCRCCommand(ASender: TIdCommand);
     procedure IdFTPServer1DeleteFile(ASender: TIdFTPServerThread;
       const APathName: String);
     procedure IdFTPServer1RetrieveFile(ASender: TIdFTPServerThread;
       const AFileName: String; var VStream: TStream);
     procedure IdFTPServer1StoreFile(ASender: TIdFTPServerThread;
       const AFileName: String; AAppend: Boolean; var VStream: TStream);
     procedure IdFTPServer1MakeDirectory(ASender: TIdFTPServerThread;
       var VDirectory: String);
     procedure IdFTPServer1RemoveDirectory(ASender: TIdFTPServerThread;
       var VDirectory: String);
   private
     { Private declarations }
     function TransLatePath( const APathname, homeDir: string ) : string;
   public
     { Public declarations }
   end;
 
 var
   FTP: TFTP;
 
 implementation
 
 {$R *.DFM}
 
 function CalculateCRC( const path: string ) : string;
 var
   f: tfilestream;
   value: dword;
   IdHashCRC32: TIdHashCRC32;
 begin
   IdHashCRC32 := nil;
   f := nil;
   try
     IdHashCRC32 := TIdHashCRC32.create;
     f := TFileStream.create( path, fmOpenRead or fmShareDenyWrite ) ;
     value := IdHashCRC32.HashValue( f ) ;
     result := inttohex( value, 8 ) ;
   finally
     f.free;
     IdHashCRC32.free;
   end;
 end;
 
 function GetSizeOfFile( const APathname: string ) : int64;
 begin
   result := FileSizeByName( APathname ) ;
 end;
 
 
 
 function GetNewDirectory( old, action: string ) : string;
 var
   a: integer;
 begin
   if action = '../' then
   begin
     if old = '/' then
     begin
       result := old;
       exit;
     end;
     a := length( old ) - 1;
     while ( old[a] <> '\' ) and ( old[a] <> '/' ) do
       dec( a ) ;
     result := copy( old, 1, a ) ;
     exit;
   end;
   if ( action[1] = '/' ) or ( action[1] = '\' ) then
     result := action
   else
     result := old + action;
 end;
 function SlashToBackSlash( const str: string ) : string;
 var
   a: dword;
 begin
   result := str;
   for a := 1 to length( result ) do
     if result[a] = '/' then
       result[a] := '\';
 end;
 
 
 function TFTP.TransLatePath( const APathname, homeDir: string ) : string;
 var
   tmppath: string;
 begin
   result := SlashToBackSlash( homeDir ) ;
   tmppath := SlashToBackSlash( APathname ) ;
   if homedir = '/' then
   begin
     result := tmppath;
     exit;
   end;
 
   if length( APathname ) = 0 then
     exit;
   if result[length( result ) ] = '\' then
     result := copy( result, 1, length( result ) - 1 ) ;
   if tmppath[1] <> '\' then
     result := result + '\';
   result := result + tmppath;
 end;
 
 
 
 procedure TFTP.IdFTPServer1ChangeDirectory(ASender: TIdFTPServerThread;
   var VDirectory: String);
 begin
 VDirectory := GetNewDirectory( ASender.CurrentDir, VDirectory ) ;
 end;
 
 procedure TFTP.IdFTPServer1GetFileSize(ASender: TIdFTPServerThread;
   const AFilename: String; var VFileSize: Int64);
 begin
 VFileSize := GetSizeOfFile( TransLatePath( AFilename, ASender.HomeDir ) ) ;
 end;
 
 procedure TFTP.IdFTPServer1ListDirectory(ASender: TIdFTPServerThread;
   const APath: String; ADirectoryListing: TIdFTPListItems);
 procedure AddlistItem( aDirectoryListing: TIdFTPListItems; Filename: string; ItemType: TIdDirItemType; size: int64; date: tdatetime ) ;
   var
     listitem: TIdFTPListItem;
   begin
     listitem := aDirectoryListing.Add;
     listitem.ItemType := ItemType;
     listitem.FileName := Filename;
     listitem.OwnerName := 'anonymous';
     listitem.GroupName := 'all';
     listitem.OwnerPermissions := '---';
     listitem.GroupPermissions := '---';
     listitem.UserPermissions := '---';
     listitem.Size := size;
     listitem.ModifiedDate := date;
   end;
 
 var
   f: tsearchrec;
   a: integer;
 begin
   ADirectoryListing.DirectoryName := apath;
 
   a := FindFirst( TransLatePath( apath, ASender.HomeDir ) + '*.*', faAnyFile, f ) ;
   while ( a = 0 ) do
   begin
     if ( f.Attr and faDirectory > 0 ) then
       AddlistItem( ADirectoryListing, f.Name, ditDirectory, f.size, FileDateToDateTime( f.Time ) )
     else
       AddlistItem( ADirectoryListing, f.Name, ditFile, f.size, FileDateToDateTime( f.Time ) ) ;
     a := FindNext( f ) ;
   end;
 
   FindClose( f ) ;
 end;
 
 
 procedure TFTP.IdFTPServer1UserLogin(ASender: TIdFTPServerThread;
   const AUsername, APassword: String; var AAuthenticated: Boolean);
 begin
 AAuthenticated := ( AUsername = 'imagina' ) and ( APassword = 'sport' ) ;
   if not AAuthenticated then
     exit;
   ASender.HomeDir := '/';
   asender.currentdir := '/';
 end;
 
 procedure TFTP.IdFTPServer1RenameFile(ASender: TIdFTPServerThread;
   const ARenameFromFile, ARenameToFile: String);
 begin
 if not MoveFile( pchar( TransLatePath( ARenameFromFile, ASender.HomeDir ) ) , pchar( TransLatePath( ARenameToFile, ASender.HomeDir ) ) ) then
     RaiseLastWin32Error;
 end;
 
 procedure TFTP.FormActivate(Sender: TObject);
 begin
  with IdFTPServer1.CommandHandlers.add do
   begin
     Command := 'XCRC';
     OnCommand := IdFTPServer1CommandXCRCCommand;
   end;
   IdFTPServer1.Active := true;
 end;
 
 
 
 
 procedure TFTP.IdFTPServer1CommandXCRCCommand(ASender: TIdCommand);
 // note, this is made up, and not defined in any rfc.
 var
   s: string;
 begin
   with TIdFTPServerThread( ASender.Thread ) do
   begin
     if Authenticated then
     begin
       try
         s := ProcessPath( CurrentDir, ASender.UnparsedParams ) ;
         s := TransLatePath( s, TIdFTPServerThread( ASender.Thread ) .HomeDir ) ;
         ASender.Reply.SetReply( 213, CalculateCRC( s ) ) ;
       except
         ASender.Reply.SetReply( 500, 'file error' ) ;
       end;
     end;
   end;
 end;
 
 procedure TFTP.IdFTPServer1DeleteFile(ASender: TIdFTPServerThread;
   const APathName: String);
 begin
 DeleteFile( pchar( TransLatePath( ASender.CurrentDir + '/' + APathname, ASender.HomeDir ) ) ) ;
 end;
 
 procedure TFTP.IdFTPServer1RetrieveFile(ASender: TIdFTPServerThread;
   const AFileName: String; var VStream: TStream);
 begin
 VStream := TFileStream.create( translatepath( AFilename, ASender.HomeDir ) , fmopenread or fmShareDenyWrite ) ;
 end;
 
 procedure TFTP.IdFTPServer1StoreFile(ASender: TIdFTPServerThread;
   const AFileName: String; AAppend: Boolean; var VStream: TStream);
 begin
 if FileExists( translatepath( AFilename, ASender.HomeDir ) ) and AAppend then
   begin
     VStream := TFileStream.create( translatepath( AFilename, ASender.HomeDir ) , fmOpenWrite or fmShareExclusive ) ;
     VStream.Seek( 0, soFromEnd ) ;
   end
   else
     VStream := TFileStream.create( translatepath( AFilename, ASender.HomeDir ) , fmCreate or fmShareExclusive ) ;
 end;
 
 procedure TFTP.IdFTPServer1MakeDirectory(ASender: TIdFTPServerThread;
   var VDirectory: String);
 begin
 MkDir( TransLatePath( VDirectory, ASender.HomeDir ) ) ;
 end;
 
 procedure TFTP.IdFTPServer1RemoveDirectory(ASender: TIdFTPServerThread;
   var VDirectory: String);
 begin
 RmDir( TransLatePath( VDirectory, ASender.HomeDir ) ) ;
 end;
 
 end.

un saludo
Responder Con Cita
  #11  
Antiguo 07-10-2005
Avatar de roman
roman roman is offline
Moderador
 
Registrado: may 2003
Ubicación: Ciudad de México
Posts: 20.269
Poder: 10
roman Es un diamante en brutoroman Es un diamante en brutoroman Es un diamante en bruto
Cita:
Empezado por AGAG4
En donde puedo revisar dentro del programa Cerberus para poder bajar archivos????
Pues no sé qué decirte. He instalado muchas veces ese servidor tanto en Win200 como en WinXP sin ningún problema, ni recuerdo haber tenido que hacer algo especial para su configuración. En la ventana del Cerberus te va marcando los accesos al servidor; quizá de ahí puedas ver qué está ocurriendo. Por otra parte, pudiera ser que tengas un cortafuegos que esté impidiendo la entrada.

Spynosa

Te agradezco tu aporte, creo que a muchos les interesará tu ejemplo. En las Indy recuerdo haber visto un ejemplo de cliente pero no así de servidor FTP.

// Saludos
Responder Con Cita
  #12  
Antiguo 07-10-2005
Avatar de AGAG4
AGAG4 AGAG4 is offline
Miembro
 
Registrado: ago 2004
Ubicación: Los Mochis, Sinaloa, México
Posts: 1.420
Poder: 21
AGAG4 Va por buen camino
Ok

Esta muy completo su ejemplo Spynosa, pero porque no pone algun link para bajarlo ya sea por ftp ó enviarlo por correo.

Ahora llegue en la mañana, y encendí la PC donde esta el FTP Server de Cerbeus y me encuentro con la novedad de que ahora ya puedo bajar archivos, que cosas tan raras, ayer reinicie la PC y nada, será que tiene win98 SE y tiene que estar en un WinServer ó XP????

Gracias por sus comentarios....
Responder Con Cita
  #13  
Antiguo 07-10-2005
Avatar de AGAG4
AGAG4 AGAG4 is offline
Miembro
 
Registrado: ago 2004
Ubicación: Los Mochis, Sinaloa, México
Posts: 1.420
Poder: 21
AGAG4 Va por buen camino
Me Equicoque

Retiro lo dicho anteriormente que me había funcionado, lo que paso es que no tenía abierto el Cerberus, hice la prueba en la PC donde esta instalado este FTP....Mil Disculpas Sigue el problema no puedo descargar archivos....
Responder Con Cita
  #14  
Antiguo 07-10-2005
Avatar de Sotrono
Sotrono Sotrono is offline
Miembro
 
Registrado: abr 2004
Ubicación: Buenos Aires - Argentina
Posts: 396
Poder: 20
Sotrono Va por buen camino
Cita:
Empezado por roman
En las Indy recuerdo haber visto un ejemplo de cliente pero no así de servidor FTP.
Los ejemplos de la version 10 si traen uno. Pero tuve algunos problemas para hacer que funcione.
Responder Con Cita
  #15  
Antiguo 07-10-2005
Avatar de AGAG4
AGAG4 AGAG4 is offline
Miembro
 
Registrado: ago 2004
Ubicación: Los Mochis, Sinaloa, México
Posts: 1.420
Poder: 21
AGAG4 Va por buen camino
ok

Al hacer pruebas con varios servidores FTP, me encontre con el GuildFTPd, con este no batalle para bajar los archivos....

www.guildftpd.com

Saludos....

Última edición por AGAG4 fecha: 07-10-2005 a las 23:30:33. Razón: Corrección
Responder Con Cita
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

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 16:07:43.


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