[DUG] ISAPI upload problem

Stephen Barker Steve at webdata.co.nz
Thu Sep 22 14:13:42 NZST 2005


Hi Phil,

The problem is likely that the ContentFields property only contains the
first chunk of the file. You have to keep reading up to the content length
to get the full data.

Are you using web broker?

I don't use that - I just use straight ISAPI, but I've got some code for
this if it helps:


  TotalBytes := FECB.cbTotalBytes;   //Request.ContentLength;
  sContentType := FServerVars.values['CONTENT_TYPE'];
  p:=Pos('boundary=',LowerCase(sContentType));

  sl := TStringList.create;
  try
    if p>0 then begin
      boundary:='--'+trim(copy(sContentType,p+9,length(sContentType)));
      ParseMultipart(TotalBytes, FECB,
FECB.lpbData,FECB.cbAvailable,boundary,sl,sFileName);
    end;
  finally
    sl.free;
  end;

Plus there's more you might want in the ParseMultipart function.


Regards,
Steve

> -----Original Message-----
> From: Phil Middlemiss [mailto:phil at tumonz.co.nz] 
> Sent: Thursday, 22 September 2005 9:59 a.m.
> To: NZ Borland Developers Group - Delphi List
> Subject: [DUG] ISAPI upload problem
> 
> I have an ISAPI DLL written in Delphi that provides a form 
> for uploading a CSV file. When I try to upload the CSV file 
> it only manages to handle
> 678 lines and then produces an error (there should be over 
> 1000 lines). 
> Is there some special handling I have to do to handle uploading files?
> 
> At the moment all I am doing is reading the 
> Request.ContentFields property to access the strings from the 
> uploaded file.
> 
> Cheers,
> Phil.
> 
> _______________________________________________
> Delphi mailing list
> Delphi at ns3.123.co.nz
> http://ns3.123.co.nz/mailman/listinfo/delphi
> 
> --
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.344 / Virus Database: 267.11.4/109 - Release 
> Date: 21/09/2005
>  
> 


More information about the Delphi mailing list