Ver Mensaje Individual
  #5  
Antiguo 04-05-2015
jlrdz jlrdz is offline
Miembro
NULL
 
Registrado: ene 2011
Posts: 50
Reputación: 14
jlrdz Va por buen camino
Gracias a todos por sus respuestas y el tiempo que se tomaron en ayudarme, a fin de cuentas el archivo que me generó la importación de wsdl solicitaba que el archivo se pasara como TByteDynArray, aquí les dejaré la función que me ayudó a resolver dicho problema por si alguien más lleva a pasar por lo mismo.

Saludos.

Código Delphi [-]
function TForm1.FIleToByteArray(const FileName: string): TByteDynArray;
const BLOCK_SIZE=1024;
var BytesRead, BytesToWrite, Count : integer;
 F : FIle of Byte;
 pTemp : Pointer;
begin
 AssignFile( F, FileName );
 Reset(F);
try
 Count := FileSize( F );
 SetLength(Result, Count );
 pTemp := @Result[0];
 BytesRead := BLOCK_SIZE;
 while (BytesRead = BLOCK_SIZE ) do
 begin
  BytesToWrite := Min(Count, BLOCK_SIZE);
  BlockRead(F, pTemp^, BytesToWrite , BytesRead );
   pTemp := Pointer(LongInt(pTemp) + BLOCK_SIZE);
  Count := Count-BytesRead;
 end;
finally
  CloseFile( F );
 end;
end;

Así se manda llamar...
Código Delphi [-]
var nImagenArray :TByteDynArray;
begin
...
   nImagenArray := FileToByteArray('c:\rutaimagenejemplo.jpg');
...
end;
Responder Con Cita