Ver Mensaje Individual
  #1  
Antiguo 05-03-2005
Avatar de DarkByte
DarkByte DarkByte is offline
Miembro
 
Registrado: sep 2003
Ubicación: Desconocido
Posts: 1.322
Reputación: 22
DarkByte Va por buen camino
Transferencia FTP no se finaliza

Buenas!... aquí estoy de nuevo.. siento no rondar con tanta frecuencia como antes.. pero los estudios no me lo permiten...

He leido el artículo y el código fuente de un tal Andrew (no recuerdo el apellido) sobre cómo hacer un servidor ftp en Delphi usando las Indy..
luego he encontrado el código fuente traducido en

http://www.clubdelphi.com/foros/show...ight=%2Aftp%2A
www.sotrono.gratishost.com/ServerFTP.zip

Y... al probar el código.. me doy cuenta de que al subir algún dato al servidor.. el archivo se pasa completamente...
pero no se llega a finalizar la subida de datos, es decir, se queda colgado sin enviar datos, en vez de refrescar el directorio y dar por finalizada la subida de datos.

Este es el procedure del servidor para cuando el cliente va a subir algo al servidor

Código Delphi [-]
procedure TMainForm.IdFTPServerStoreFile(ASender: TIdFTPServerThread;
  const AFileName: String; AAppend: Boolean; var VStream: TStream);
  var APath : string;
begin
   APath := StrGetRealPathName(TFTPClient(ASender.Data).RootPath,ASender.CurrentDir,AFilename);
   if DirectoryExists(ExtractFilePath(APath)) then
   begin
     if AAppend then //Método de adicion
     begin
          VStream := TFileStream.Create(APath, fmOpenWrite or fmShareExclusive);//Abrir el fichero
          VStream.Seek(0, soFromEnd); //Colocarse en el final
      end
      else
          VStream := TFileStream.Create(APath, fmCreate or fmShareExclusive); //Crear el fichero
   end
   else
     raise Exception.Create(Format('%s: Errorirectorio inexistente o archivo ocupado',[AFilename]));
end;

Utilizo Delphi 7, WinXp y pasta dental Colgate.

Muchísimas gracias, simplemente, por leerme.
__________________
:)

Última edición por DarkByte fecha: 05-03-2005 a las 10:42:43. Razón: Me he pasado con el ancho de línea
Responder Con Cita