🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #3910

Re: TIdHTTPServer and ServeFile

#3910
From: Remy Lebeau (TeamB)
Date: Thu, 19 May 2005 10:28
22 lines
1788 bytes
"Lapo Guidi" <lapoguidi@inwind.it> wrote in message
news:428be9c6@newsgroups.borland.com...

> If I click over the link in a page using the client (Internet Explorer),
> the zip file is written on the html page. If I right-click on the link
> and I choose "Save target as..." the zip is correctly saved where
> I want, but the name is sendfile.html.

You are not specifying the proper header values to let the browser know that
the file is downloadable, and what its filename should be.

> I use this row of code in the OnCommandGet:
> HTTP->ServeFile(AThread, AResponseInfo, "c:\\test.zip");

Add the following line of code before calling ServeFile():

    AResponseInfo.CustomHeaders.Values['Content-Disposition'] :=
'attachment; filename="test.zip"';


Gambit
Technical Details
Message-ID: <428c6a29@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsgate.cistron.nl!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!news-in.nuthinbutnews.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <428be9c6@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,e3a37c22dc9da9c8
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <428be9c6@newsgroups.borland.com>
Subject: Re: TIdHTTPServer and ServeFile
Date: Thu, 19 May 2005 03:28:53 -0700
Lines: 24
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <428c6a29@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1116498473 68.69.17.41 (19 May 2005 03:27:53 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsgate.cistron.nl!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!news-in.nuthinbutnews.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail