Skip to content

Download file in Livewire #101

Answered by gid-m
gid-m asked this question in Q&A
Aug 23, 2022 · 4 comments · 6 replies
Discussion options

You must be logged in to vote

After tinkering with it, I ended up having to do this to start the download:

$writer->addRow($row);

return response()->streamDownload(function () use ($writer) {
            $writer->close();
        },  $fileName);

Hence omitting $writer->toBrowser();

Replies: 4 comments 6 replies

Comment options

You must be logged in to vote
2 replies
@Ceepster14
Comment options

@gauravgargcs
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by gid-m
Comment options

You must be logged in to vote
4 replies
@shokanshi
Comment options

@gauravgargcs
Comment options

@shokanshi
Comment options

@gauravgargcs
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants
Converted from issue

This discussion was converted from issue #100 on August 23, 2022 06:55.