Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Problema com o Res.SendFile, usando THorse.Get('*', function) #366

Open
Labels
bugSomething isn't working

Description

Boa tarde,

Em meu servidor possuo um endpoin registrado assim:
THorse.Get('*', captura_arquivo);

O captura_arquivo:

 try
 LStream := TFileStream.Create(ApplicationPath+'horse.pdf', fmOpenRead);
 Res.SendFile(LStream, 'horse.pdf', 'application/pdf').Status(200);
 finally
 try
 FreeAndNil(LStream);
 except on E: Exception do
 end;
 end;

Oque ocorre, se o endpoint tiver sido registrao como "*" o SendFile não funciona.
Porém se chamar o mesmo captura_arquivo através de um endpoint com um nome:
THorse.Get('arquivo', captura_arquivo);

O arquivo é exibido normalmente no navegador

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Todo

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /