#1 2012-09-14 15:39:06

Chris75018
Member
From: France
Registered: 2012-09-14
Posts: 26
Website

Change filename of a STATICFILE document from CALLBACKGET Method ?

Hi,
When I  try to download a file (HTTP_RESP_STATICFILE) from a CALLBACKGET Method (TSQLRESTServer class), the output filename is the CALLBACKGET Method name.
Is anyone know what must i do for change it ?

        sIn := StringToUTF8(vfilename);
        sHead := 'Content-Type: ' + HTTP_RESP_STATICFILE;
        aParams.Head^ := sHead;
        aParams.Resp := sIn;
        result := 200;

The aim is to download a client application for a local network server from his location (SERVERIP/client/Index?myInstallclient.exe).

Offline

#2 2012-09-17 08:14:20

Chris75018
Member
From: France
Registered: 2012-09-14
Posts: 26
Website

Re: Change filename of a STATICFILE document from CALLBACKGET Method ?

Sorry,

All is in the header :

        sIn := StringToUTF8(vfilename);
        sHead := 'Content-Type: ' + HTTP_RESP_STATICFILE  + #13 +
                 'Content-Disposition: attachment; filename="MyInstallprog.exe"';
        aParams.Head^ := sHead;
        aParams.Resp := sIn;
        result := 200;

Offline

#3 2012-09-17 13:54:47

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,240
Website

Re: Change filename of a STATICFILE document from CALLBACKGET Method ?

You are right.

Offline

Board footer

Powered by FluxBB