Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Internet (https://www.clubdelphi.com/foros/forumdisplay.php?f=3)
-   -   Transferencia FTP no se finaliza (https://www.clubdelphi.com/foros/showthread.php?t=19132)

DarkByte 05-03-2005 10:39:35

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: Error:Directorio inexistente o archivo ocupado',[AFilename]));
end;

Utilizo Delphi 7, WinXp y pasta dental Colgate.

Muchísimas gracias, simplemente, por leerme.


La franja horaria es GMT +2. Ahora son las 07:21:00.

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