Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Go Back   Foros Club Delphi > Principal > Varios
Register FAQ Members List Calendar Guía de estilo Today's Posts

Coloboración Paypal con ClubDelphi

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 15/04/2013
wolfran_hack wolfran_hack is offline
Miembro
 
Join Date: Apr 2013
Posts: 97
Poder: 14
wolfran_hack Va por buen camino
Problema a descargar actualización mediante WinInet

CODE:

Código Delphi [-]
function DescargarArchivo( sURL, sArchivoLocal: String ): boolean;
const BufferSize = 1024;
var
  hSession, hURL: HInternet;
  Buffer: array[1..BufferSize] of Byte;
  LongitudBuffer: DWORD;
  F: File;
  sMiPrograma: String;
begin
  sMiPrograma := ExtractFileName( Application.ExeName );
  hSession := InternetOpen( PChar( sMiPrograma ), INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0 );

  try
    hURL := InternetOpenURL( hSession, PChar( sURL ), nil, 0, 0, 0 );

    try
      AssignFile( F, sArchivoLocal );
      Rewrite( F, 1 );

      repeat
        InternetReadFile( hURL, @Buffer, SizeOf( Buffer ), LongitudBuffer );
        BlockWrite( F, Buffer, LongitudBuffer ); //ERROR AQUI.
      until LongitudBuffer = 0;

      CloseFile( F );
      Result := True;
    finally
      InternetCloseHandle( hURL );
    end
  finally
    InternetCloseHandle( hSession );
  end
end;

Código Delphi [-]
procedure Form1.Button1Click(Sender: TObject);
begin
  DescargarArchivo( 'http:\\site.com\dni.csv', 'C:\dni.csv' );
end;

El archivo pesa 20Kb y me tirar error en el Buffer señalando esa linea y el texto:

Quote:
Project DNI.exe raised exception class EInOutError with message 'I/O error 1784'. Process stopped. Use Step or Run to continue.
Alguna idea?
Reply With Quote
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error al descargar actualizacion de mi aplicacion sitrico Internet 2 12/07/2010 23:15
Descargar archivos mediante un formulario pampitasnowman PHP 17 15/05/2007 16:39
ftp problema al descargar ficheros Trisckel Internet 1 04/04/2007 10:32
actualizacion mediante ftp emenchi34 Internet 5 04/12/2006 19:00
Descargar archivos de directorio protegido mediante apache chux PHP 0 25/09/2006 12:59


All times are GMT +2. The time now is 21:10.


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