Skip to content

Display a file, such as an image or PDF, directly in the user's browser #47784

@alexbog8

Description

@alexbog8

Symfony version(s) affected

6.0.13, 6.1.5

Description

Laravel official documentation says that to display a file in a user browser a simple return response()->file($filePath) will suffice. Since the current version, 6.0.13 this command will show the binary content of the file, not the file itself!

Screenshot 2022-10-04 at 15 37 34

How to reproduce

return response()->file($pathToFile);

Possible Solution

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions