-
-
Notifications
You must be signed in to change notification settings - Fork 334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[LiveComponent] Live Actions cannot handle file downloads #1516
Comments
Hello @richardhj there is no support of File responses currently in LiveComponent Couple of solutions:
-- Some quotes cherry-picked from the RFC9110, in favor of the POST -> redirection -> GET solution
-- Now what seems weird to me is how the response seems handled and displayed in your example/capture... that may need some improvement / bug fixes :) |
Hi @smnandre, thats valuale information, I implemented a redirect to a "download controller" 👍 👍 However, that redirect must be uri-signed, so I can make sure that only "authorized" files can be downloaded. |
same need here, so maybe this should be considered to be in core 🤔 |
would be awesome if file response handling would work one day ❤️ |
+1 |
2 similar comments
+1 |
+1 |
Hey guys, this is not how OSS work and you are spamming other people's mailboxes. |
Hi @stefpe, @x-vlad-x, @sebbemunich, I understand your desire to see this feature implemented. However, as @richardhj mentioned, this is an open-source project, so you can either:
If you want to support @barbieswimcrew's suggestion, thumbing up the first message in the issue is the best way, as it allows us to sort by this. I performed a brief test with this method, which could serve as an implementation idea. This is similar to how Livewire implements this feature. Here are some considerations for the implementation:
However, implementing this will take some time, which I currently do not have, as we all work on this in our free time. (and I still believe that redirecting to a file is a much cleaner solution 😄 ) |
This option would really be very useful. |
@smnandre, thank you for the following suggestion (and congrats for your place in the Symfony UX Core Team 👍)
Just in case someone found this topic and is trying to implement a download from a LiveComponent using a
If turbo is enabled (it is if you have initialized your symfony project with If you share data between the live component and the controller route with a session and you manipulate this data (add/remove), you will have unexpected results (eg : Adding the attribute
The url of RedirectResponse() is now called only once (on symfony 7.2.2 up to date at the time of this post) |
Hi @zefyx! Thank you for sharing this feedback (and the kind words). We are working on a proper implementation of downloads with LiveComponent on the PR here #2483 But this is something that could be mentioned anyway on the documentation I think. Probably just after we speak about file uploads, in a dedicated "Download" paragraph Maybe just a paragraph ending with the HTML you provided here... |
As live actions are treated as regular controller actions, they should also support file responses.
Currently, file downloads are not downloaded but parsed..?
Edit (current workaround)
The text was updated successfully, but these errors were encountered: