🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.web
Article #1542

TWebRequest: How do I upload files?

#1542
From: TerryC
Date: Thu, 02 Sep 2004 20:45
33 lines
1853 bytes
I have a functioning ISAPI application to which I want to add
file upload capability.  The Borland help files don't give much
useful information about how this might be accomplished.  I
found the Files property of the TWebRequest object and thought I
had hit pay dirt, but it doesn't seem to work, AFAICT.

I tried the ReadClient() method with this code:

void __fastcall TWMod::WModaiPostUploadAction(TObject *Sender,
   TWebRequest *Request, TWebResponse *Response, bool &Handled)
{
   int ByteCount;
   char *Buffer = new char[Request->ContentLength];

   ByteCount =
      Request->ReadClient(Buffer, Request->ContentLength);
   Response->Content =
      "Request->ContentLength = " +
      IntToStr(Request->ContentLength) + ".  " +
      IntToStr(ByteCount) + " bytes transferred.";

   delete [] Buffer;
   Handled = true;
}

...and I always get -1 bytes transferred.

Does someone have experience and/or some direction to send me
for more help on this?  I'm not finding much on Google either...

Many thanks for your time.
Terry
Technical Details
Message-ID: <4137865a$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed.mesh.ad.jp!newsfeed.media.kyoto-u.ac.jp!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,13e82ec923f5058e,start
X-Google-Attributes: gidfeeec,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "TerryC" <terryc@sweetwaterhsa.com>
Sender: "TerryC" <terryc@sweetwaterhsa.com>
Reply-To: "TerryC" <terryc@sweetwaterhsa.com>
Subject: TWebRequest: How do I upload files?
Newsgroups: borland.public.cppbuilder.internet.web
X-User-Info: 63.250.179.198     
NNTP-Posting-Host: 207.105.83.66
Message-ID: <4137865a$1@newsgroups.borland.com>
Date: 2 Sep 2004 13:45:14 -0700
X-Trace: newsgroups.borland.com 1094157914 207.105.83.66 (2 Sep 2004 13:45:14 -0700)
Lines: 34
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed.mesh.ad.jp!newsfeed.media.kyoto-u.ac.jp!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail