[DUG] ISAPI upload problem
Jeremy Coulter
vss at vss.co.nz
Thu Sep 22 15:55:42 NZST 2005
I came across some code for doing it in a CGI app, and converted it to a COM
app that uses the ASP engine in Delphi, and I THINK I still have the code
for teh CGI app. somewhere.
Email me offline if you want it.
Jeremy
-----Original Message-----
From: Phil Middlemiss <phil at tumonz.co.nz>
To: NZ Borland Developers Group - Delphi List <delphi at ns3.123.co.nz>
Date: Thu, 22 Sep 2005 15:42:45 +1200
Subject: Re: [DUG] ISAPI upload problem
Thanks for the replies everyone - I've been on a course all day so have only
just read them now.
I am using the "multipart/form-data" method="post" that Trevor gave an
example of (no web broker). So I think it was a case of needing to keep on
reading.
Thanks for the attachment trevor - I will give it a go.
Cheers,
Phil.
Stephen Barker wrote:
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
_______________________________________________
Delphi mailing list
Delphi at ns3.123.co.nz
http://ns3.123.co.nz/mailman/listinfo/delphi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ns3.123.co.nz/pipermail/delphi/attachments/20050922/5d1735e1/attachment.html
More information about the Delphi
mailing list